On Thu, 21 Jul 2011 17:31:04 -0700
Glenn Linderman <v+pyt...@g.nevcal.com> wrote:
> 
> If I have (on sys.path), a directory "x" containing a "y.py" module, and 
> later (on sys.path), another directory "x" containing a "y.py" module, 
> what is "from x import y" supposed to do?
> 
> OR
> 
> If I have (on sys.path), a module "x.py" containing, say:
> 
>     y = 5
> 
> and later (on sys.path), another module "x.py" containing, say:
> 
>     y = 6
> 
> what is "from x import y" supposed to do?
> 
> 
> I guess I don't see how this new proposal makes anything more confusing 
> than it already is?

It does. In your two examples, the "x.py" files (or the "x" directories)
live in two different base directories; imports are then resolved in
sys.path order, which is expected and intuitive.

However, you can have a "x.py" file and a "x" directory *in the same
base directory which is present in sys.path*, meaning sys.path can't
help disambiguate in this case.

Regards

Antoine.


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to