[New-bugs-announce] [issue15627] Add a method to importlib.abc.SourceLoader for converting source to a code object

Brett Cannon report at bugs.python.org
Sun Aug 12 02:44:36 CEST 2012


New submission from Brett Cannon:

A classmethod called importlib.abc.SourceLoader.source_to_code(source_bytes, path) would return a code object. By default it would be equivalent to ``compile(source_bytes, source_path, 'exec', dont_inherit=True)``, but others could override this to e.g. convert the source to an AST, optimize the AST, and then call compile() to get the desired code object.

----------
components: Library (Lib)
messages: 168015
nosy: brett.cannon, eric.snow
priority: low
severity: normal
stage: test needed
status: open
title: Add a method to importlib.abc.SourceLoader for converting source to a code object
versions: Python 3.4

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


More information about the New-bugs-announce mailing list