[Import-SIG] PEP 402 implementation

Eric Snow ericsnowcurrently at gmail.com
Thu Jul 21 01:26:18 CEST 2011


On Wed, Jul 20, 2011 at 2:08 PM, Brett Cannon <brett at python.org> wrote:
> Obviously feel free to ask me questions (publicly or privately) if anything
> in the importlib code is an issue for you (I know its structure for
> bootstrapping reasons is a bit odd).

Thanks.  To be honest, with the time I have spent in importlib in the
last couple months I realize how much work you put into it, so thanks.
 It makes it really easy to hack the import mechanism.

> I really doubt anyone has jumped into this as much as you have, Eric. =) You
> can also always do it on bitbucket or somewhere so that others can
> collaborate. I believe there is even a cpython mirror there so that should
> make it easy to fork and pull in updates.

Yep, already have my bitbucket clone (haven't pushed committed to it
yet though).

>> Secondly, regardless of importlib or import.c or whatever, the sys
>> module will need to have "virtual_packages" added right?  I stuck that
>> code in import.c next to where sys.meta_path and others get
>> initialized [1].  Is that the right place to do it?  Should it go in
>> sysmodule.c instead?
>
> I can understand populating those properties in import.c, but it is probably
> better to initialize the empty data structures in sysmodule.c so that the
> code to get the module in a basic state is centralized. but if sys.meta_path
> and friends are elsewhere then you can start there and have a separate patch
> (file a bug now, though) to possibly relocate the code later.

Good idea.  I submitted issue 12598 along with a patch.

-eric


More information about the Import-SIG mailing list