[issue2377] Replace __import__ w/ importlib.__import__
report at bugs.python.org
Thu Feb 23 17:47:46 CET 2012
Brett Cannon <brett at python.org> added the comment:
On Wed, Feb 22, 2012 at 19:35, Éric Araujo <report at bugs.python.org> wrote:
I have already done that and pushed the initial change. The ultimate goal
will be fetching from sys.modules when level == 0 and not bool(fromlist)
only touch C code. All other work will touch varying levels of Python code.
Someone else can worry about speeding up fromlist so that only C code is
touched when level == 0.
I also have some failing tests, but that all has to do with Antoine's
caching work and thus fails in the default branch as well when the tests
are run under importlib itself (i.e. tests that generate a file and then
immediately try to import it). But what's nice is that test_reprlib now
fails only in my bootstrap branch and not default because it is just fast
enough to beat the directory mtime granularity. =)
Ha! I wish. I have to get within reasonable striking distance of current
performance or else I will get blocked for including the work.
It's possible as long as it is exposed through imp.
> 4) When is PyPy going to be the reference implementation again? Then
> we’ll have no speed issues—ha ha only serious.
> 5) importlib rocks hard.
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list