[Distutils] [proposal] version-free + lookup-friendly dist-info location

Nick Coghlan ncoghlan at gmail.com
Sat Mar 18 03:49:48 EDT 2017

On 18 March 2017 at 07:04, Leonardo Rochael Almeida <leorochael at gmail.com>

> On 17 March 2017 at 11:47, Paul Moore <p.f.moore at gmail.com> wrote:
>> On 17 March 2017 at 14:40, Nick Coghlan <ncoghlan at gmail.com> wrote:
>> > [...] whichever
>> > version of "foo" is first on sys.path will "win", and you won't be able
>> to
>> > import from the other one (so you'll be able to import "foo.bar" or
>> > "foo.baz", but not both). [...]
>> Really? OK, I feel stupid now, I've been making a fuss over something
>> that's actually not possible. I should have tested this. My apologies
>> (in my defense, I could have sworn I remembered someone else making
>> precisely this point sometime in the past, but I guess I'll have to
>> put that down to advancing age and brain decay...)
> Well, as Nick mentioned, if the `foo` Python package is a namespace
> package in both foo 1.0 and foo 2.0 distributions, then, yes, both `bar`
> and `baz` would be importable, and this is a case that should be documented
> somewhere.
> So, your point is not without merit.

If I recall correctly, it was also a problem in some of the suggestions
made during the discussions leading up to the acceptance of PEP 420
namespace packages, and one of the deciding factors in ruling out the
"execute all __init__.py files found in the order they're encountered on
sys.path" option.

I've been caught by that before myself, where I was reasoning about a later
problem based on a design variant we ended up rejecting, rather than the
approach that was actually implemented.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170318/8488851b/attachment.html>

More information about the Distutils-SIG mailing list