[Python-Dev] PEP 382 specification and implementation complete
"Martin v. Löwis"
martin at v.loewis.de
Sun Nov 6 09:10:59 CET 2011
I had announced this to import-sig already; now python-dev.
I have now written an implementation of PEP 382, and fixed some details
of the PEP in the process. The implementation is available at
With this PEP, a Python package P can consist of either a P/__init__.py
directory and module, or multiple P.pyp directories, or both. Using a
directory suffix resulted from the following requirements/observations:
- people apparently prefer an approach where a directory has to be
declared as a Python package (several people commented this after
my PyConDE talk, expressing dislike of how Java packages are
- people also commented that any declaration should indicate that this
is about Python, hence the choice of .pyp as the directory suffix.
- in choosing between a file marker inside of the directory (e.g.
zope-interfaces.pyp) and a directory suffix, the directory suffix
wins for simplicity reasons. A file marker would have to have a
name which wouldn't matter except that it needs to be unique - which
is a confusing requirement that people likely would fail to meet.
In the new form, the PEP was much easier to implement than in the first
version (plus I understand import.c better now).
This implementation now features .pyp directories, zipimporter support,
documentation and test cases.
As the next step, I'd like to advance this to ask for pronouncement.
More information about the Python-Dev