bullet-proofing python extension