On Thu, 21 Jul 2011 17:31:04 -0700 Glenn Linderman <v+python at 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.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4