[Import-SIG] My objections to implicit package directories

Nick Coghlan ncoghlan at gmail.com
Tue Mar 13 08:23:39 CET 2012

On Tue, Mar 13, 2012 at 5:04 PM, Barry Warsaw <barry at python.org> wrote:
> While we still support 3.2 and 3.3, our package installation helpers will
> simply continue to write __init__.py files into namespace package directories,
> just as it does now.  Since we (generally, assuming nothing insane like extra
> non-__path__ hacking code is in the upstream namespace __init__.py file)
> generally substitute a consistently written __init__.py file for namespace
> packages, containing only the standard __path__ hackery, this will continue to
> work just as it does today even after this new PEP lands.  IOW, backward
> compatibility FTW!
> Once we can drop 3.2, our helper simply removes those namespace __init__.py
> files, and all is happy in a 3.3-and-beyond world.

Right, that's why I was confused by your earlier objections - existing
namespace package implementations should continue to work just as they
do now regardless of whether the native namespace pacakge solution in
Python 3.3 uses implicit or explicit package directories (although, in
the latter case, pkgutils should likely be updated to consider both
"name" and "name.pyp" directories when asked to explicitly extending a
namespace package path in 3.3). If that ever isn't the case, then the
new proposal has a backwards compatibility problem that needs to be

(And yes, I still have some hope of persuading Guido that the
incremental step from a marker file to a marker suffix is a better
option than making the irreversible leap straight to implicit package


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Import-SIG mailing list