[Python-Dev] PEP 3147 ready for pronouncement and merging (original) (raw)

Barry Warsaw barry at python.org
Thu Apr 15 03:10:15 CEST 2010


On Apr 15, 2010, at 08:33 AM, Nick Coghlan wrote:

Brett Cannon wrote:

And just a quick suggestion: can we standardize what imp.sourcetopath() and friend are supposed to return if the interpreter doesn't support bytecode? I will probably have to rely on that for something so it would be best to say now whether it should be None or raise an exception so there is no divergence on this between VMs. Returning None sounds like the most straightforward option. "cached = None" will just mean "for whatever reason, we have no cached filename for this file". It may be the cached file doesn't exist, or the interpreter simply wasn't in a position to figure it out in a user visible way.

I completely agree. The PEP already leaves cached up to the implementation, but I'll update it to be clear that None is an acceptable return value from imp.cached_from_source() (which is the one I think you mean), and also what cached=None means.

Thanks Brett and Nick. -Barry -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: not available URL: <http://mail.python.org/pipermail/python-dev/attachments/20100414/b0b50d4d/attachment.pgp>



More information about the Python-Dev mailing list