On 2 January 2015 at 05:19, Barry Warsaw <ba...@python.org> wrote: > - Should some other boilerplate be added to the namespace-package > __init__.py > files in each portion? Maybe the sys.hexversion guards should be > removed so > that it acts the same way in both Python 2 and Python 3. >
This was the intended solution when PEP 420 was written - we deliberately didn't break old-style namespace packages, we just made them redundant for code that only needs to run on 3.3+. This is much easier to learn, since it means creating packages as subdirectories "just works", and automatically collecting all search path subdirectories with a given name into a common namespace by default better matches the typical behaviour of other search path based explicit import systems. However, implicit namespace packages aren't inherently *better* than the old explicit ones at runtime, as the end result is the same in either case: a module.__path__ entry that contains multiple directories. The only difference is in whether you get there by leaving out __init__.py and letting the 3.3+ import machinery handle it, or by doing it explicitly yourself. That means there's a bug to be fixed in the lazr packages - they provide an __init__.py file, thus turning off the implicit namespace package support, but then they use a version check to also turn off the explicit namespace package support. If you turn off both kinds of namespace package support, you're not going to have a namespace package at the end of it :) Cheers, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig