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

Nick Coghlan ncoghlan at gmail.com
Fri Jul 22 01:53:57 CEST 2011


On Fri, Jul 22, 2011 at 9:35 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:
> On Tue, 19 Jul 2011 23:58:55 -0400
> "P.J. Eby" <pje at telecommunity.com> wrote:
>>
>> Anyway, to make a long story short, we came up with an alternative
>> implementation plan that actually solves some other problems besides
>> the one that PEP 382 sets out to solve, and whose implementation a
>> bit is easier to explain.  (In fact, for users coming from various
>> other languages, it hardly needs any explanation at all.)
>
> I have a question.
>
> If I have (on sys.path) a module "x.py" containing, say:
>
>    y = 5
>
> and (also on sys.path), a directory "x" containing a "y.py" module.
>
> What is "from x import y" supposed to do?
>
> (currently, it would bind "y" to its value in x.py)

It would behave the same as it does today: the imported value of 'y' would be 5.

Virtual packages only kick in if an import would otherwise fail.

Cheers,
Nick.

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


More information about the Python-Dev mailing list