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

Greg Slodkowicz jergosh at gmail.com
Sun Aug 21 01:09:20 CEST 2011


>
> If you look closely at the proposed code, I simply avoid creating the
> parents until the last possible moment.  I don't think there's any need to
> *remove* the parents if the load fails; the idea is just that a virtual
> package's module doesn't exist until a submodule is *found* (whether or not
> it's successfully *loaded*).
>
> I think this is a reasonable compromise, as it ensures that the module
> itself will see the parents, and that if somehow something keeps a reference
> it won't end up stale/invalid.
>

I replaced _gcd_import() with your code (
https://bitbucket.org/jergosh/pep-402) and, after small changes, it passes
all but one* unittests, including ones I devised for PEP402-style imports
(the other 5 failures are due to an unrelated bug which was fixed after I
made my fork of cpython).

* I'm getting a mysterious failure
in importlib.test.import_.test_meta_path.test_no_path, no idea why.

I'd appreciate any feedback, especially more test cases and possible reasons
for the unittest failure.

Cheers,
Greg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/import-sig/attachments/20110821/d7b75554/attachment.html>


More information about the Import-SIG mailing list