[Python-Dev] Draft PEP: "Simplified Package Layout and Partitioning"

Eric Snow ericsnowcurrently at gmail.com
Thu Jul 21 04:39:19 CEST 2011


On Wed, Jul 20, 2011 at 7:52 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Even better would be for these (and sys.path) to be list subclasses
> that did the right thing under the hood as Glenn suggested. Code that
> *replaces* rather than modifies these attributes would still
> potentially break virtual packages, but code that modifies them in
> place would do the right thing automatically. (Note that all code that
> manipulates sys.path and __path__ attributes requires explicit calls
> to correctly support current namespace package mechanisms, so this
> would actually be an improvement on the status quo rather than making
> anything worse).

+1 as a solution to the problem Glenn brought up.  However, I'm still
not clear on how much code out there changes sys.path in the offending
way, forcing the need to provide a more implicit solution in this PEP
than extend_virtual_paths().  And in cases where sys.path *is*
changed, and it impacts some virtual package, how many places is that
going to happen in one project?  My guess is not many (and so not many
"boilerplate" calls).  Is it worth adding implicit __path__ updates
for that use case, rather than just the extend_virtual_paths()
function?

As an aside, my first reaction to Glenn's suggestion was "that would
be cool".  Would it be a pursuable option?  We can take this over to
import-sig if it is.

-eric


More information about the Python-Dev mailing list