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

Brett Cannon brett at python.org
Sun Aug 21 01:31:01 CEST 2011

On Sat, Aug 20, 2011 at 16:09, Greg Slodkowicz <jergosh at gmail.com> wrote:

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

Can you be more specific about what the failure is? That specific test has
multiple asserts. The point of the test is to simply make sure that
meta_path finders get called with None when __path__ is not defined.


> I'd appreciate any feedback, especially more test cases and possible
> reasons for the unittest failure.
> Cheers,
> Greg
> _______________________________________________
> 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/20110820/b90e7cbc/attachment.html>

More information about the Import-SIG mailing list