[Import-SIG] New PEP draft: "Simplified Package Layout and Partitioning"

P.J. Eby pje at telecommunity.com
Thu Jul 14 20:13:52 CEST 2011


At 01:16 PM 7/14/2011 +1000, Nick Coghlan wrote:
>We may also want to provide (probably in importlib) a way to walk the
>*potentially* importable modules on a path entry without actually
>importing them.

No problem.  Let me just set the time machine for 2006 and add it to 
pkgutil instead, so it'll be in Python 2.5+.  How dos the name 
'iter_modules()' sound?  ;-)


>While I understand the desire to focus on an import.c/pkgutil.py based
>implementation at this point, it's highly likely than builtin
>__import__ will be importlib based for 3.3. I'd be a lot happier if we
>stopped double-keying work and just wrote the importlib versions
>rather than messing with the soon-to-die C code any further.

Since I'm not doing the actual work for 3.3, I don't really care how 
it gets done.  I just don't want to make the *specification* depend 
on that, which is why I'm saying "imp" for the API rather than 
importlib.  When importlib goes in, after all, imp will be importing 
lots of other things from it anyway.  ;-)

That all being said, if somebody Pronounces that importlib is the 
right place to expose it, that's fine too.

(Presumably pkgutil will need some refactoring as well, since it 
currently simulates some things that're probably alo implemented in importlib.)




More information about the Import-SIG mailing list