[issue15031] Split .pyc parsing from module loading

Brett Cannon report at bugs.python.org
Sun Aug 12 02:39:29 CEST 2012


Brett Cannon added the comment:

So the more I think about this, the more I'm willing to do this in Python 3.4. First, though, the docs would need to be updated in importlib to distinguish between bytecode and byte-compiled files.

>From there, I think importlib.abc.SourceLoader.parse_byte_compiled_file(data) could exist. It would be a classmethod so people can call it directly if they really want. It would verify the magic number, and if that's good, return a dict that can be directly compared against what path_stats() returns plus the bytecode for the module. This should properly shield the format of bytecode from users while still providing an API people can rely on.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15031>
_______________________________________


More information about the Python-bugs-list mailing list