Nick Coghlan <ncoghlan@...> writes:
Accordingly, the proposal I'm most amenable to is the one to simply change the default precedence of the current directory on sys.path by moving it to the end of the filesystem search (after the standard library, site-packages, user site-packages, etc). This wouldn't affect the -m switch (or the runpy module in general), since that manipulates sys.path directly, and would mean creating a "socket.py" script to experiment with the socket modules would "just work".
That would mean that any addition of a module in the standard libary is a compatibility break, because the new module in the standard library would shadow any module in the local directory.
To me the cleanest (from a user point of view) way would be to enable "from . import xxx" in scripts outside packages. When I learned about relative imports I was really surprised by this limitation. If it was possible I'd use it everywhere.