[issue2377] Replace __import__ w/ importlib.__import__

Éric Araujo report at bugs.python.org
Thu Feb 23 01:35:07 CET 2012


Éric Araujo <merwok at netwok.org> added the comment:

> I also think that [there] is still too much C code as it makes the whole thing somewhat brittle
> to any refactoring of importlib. I am seriously thinking of tossing the C code I have written and
> writing in C only the bare minimum needed to get to the sys.modules check, and otherwise punting
> to importlib for everything else in a single call or two.

A few thoughts from my outsider viewpoint:

1) I think the point of importlib is to have maintainable code (i.e. the anti-import.c <wink>), so writing only the minimum code in C makes sense.

2) Speed is a concern, especially with sysconfig in 3.3 slowing startup, but a secondary concern.

3) Maybe some parts can be written in C later, after profiling, and then override Python functions (à la “from _heapq import *”, if that’s possible at all for importlib).

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>
<http://bugs.python.org/issue2377>
_______________________________________


More information about the Python-bugs-list mailing list