[Import-SIG] PEP 402 implementation

Brett Cannon brett at python.org
Wed Jul 20 22:08:42 CEST 2011


On Wed, Jul 20, 2011 at 13:02, Eric Snow <ericsnowcurrently at gmail.com>wrote:

> Last night I had a chance to get started on an implementation for the
> PEP.  I'm taking the importlib route.  Before I do much more I wanted
> to check on a couple of things with this group.
>

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).



>
> First of all, I don't want to go to much effort here if others are
> already focused on the implementation, particularly since I'm sure all
> of you would do a better job than I would.  I already feel like I have
> butt in on the work Barry, Eric, and crew were getting started. <wink>
>  If someone is already going to take care of the implementation please
> let me know.
>

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.


>
> In case you haven't noticed, Python is my first foray into an
> open-source project, and I've only been involved since the pycon
> sprints (been using Python exclusively for 5 years though).   So, I am
> still feeling out the mechanics of how people cooperate on this sort
> of stuff.
>
> 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.

-Brett


>
> Thanks,
>
> -eric
>
> [1] http://hg.python.org/cpython/file/default/Python/import.c#l204
> _______________________________________________
> Import-SIG mailing list
> Import-SIG at python.org
> http://mail.python.org/mailman/listinfo/import-sig
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20110720/bb4c485f/attachment.html>


More information about the Import-SIG mailing list