Yesterday Jason Coombs, Barry Warsaw, and I met for about 6 hours of
sprinting on PEP 420.
We added a test framework and added tests for namespace packages using
the filesystem loader and zipimport loader. We flushed out a bug in
zipimport's namespace finder support as part of this.
We identified the following issues which need to get resolved before the
PEP is ruled on:
1. What about __file__? Barry is currently discussing this in the other
2: Parent path modification detection. I'm still thinking this one over.
I'm going to look into whipping up a sample implementation.
I think these can all be resolved this weekend, so we'll ask that a
ruling be made on the PEP next week. Please let me know if you have
other PEP (not implementation) concerns.
There are also these quality of implementation issues that I don't think
need to get addressed before PEP 420 is ruled on:
2. More tests. We need to test namespace packages as sub-packages, not
just top level.
3. The zipimport finder currently looks for "path/" to detect if a
'directory' exists and could be a namespace portion. However, this is a
valid zip file:
Length Date Time Name
--------- ---------- ----- ----
0 2012-05-04 04:45 bar/
35 2012-05-04 04:45 bar/two.py
26 2012-05-04 04:45 foo/one.py
61 3 files
The current code will treat "bar" as a possible portion, but not "foo".
We discussed a number of ways to address this, but I'm unconvinced
they're worth the hassle and runtime expense. But in any event, it's an
issue for another day and doesn't affect the PEP's acceptance one way or
All of the code is checked in to features/pep-420.