Re: PEP 420: Implicit Namespace Packages
Yury Selivanov <[email protected]>
| Newsgroups | gmane.comp.python.import |
|---|---|
| Message-ID | <[email protected]> |
On 2012-05-05, at 9:18 AM, Nick Coghlan wrote: > Now rename zope/ to zope.pyp/ in a full Zope checkout and see how much > noise you get. Why can't we modify whatever PEP to simply mark namespace package with '__init__.pyp' or some other special file? Why rename directories, introduce ugly suffixes, deal with all the weirdness of importing just plain directories and guessing that they are namespace packages, ignoring content in __init__.py etc, instead of plain simple file marker? In terms of steps (as Nick illustrated): With PEP 382, the migration path is: 1. delete all __init__.py files from namespace package portions 2. rename the directories for all namespace package portions to append the ".pyp" extension With PEP 420, the migration path is: 1. delete all __init__.py files from namespace package portions 2. there is no step 2 With a marker: 1. $ mv __init__.py __init__.pyp 2. there is no step 2 The first step can be even replaced with '$ rm __init__.py && touch __init__.pyp', as current __init__.py files of namespace packages contain only '__path__ = extend_path(__path__ ...)' crap. - Yury