Nick Coghlan <ncogh...@gmail.com> added the comment:

Folks use "python -m myproject.mymodule" to run code that they're working on 
all the time - it's currently the only way to get sys.path right for cases like 
that (otherwise you're exposed to the double import trap, where you can get two 
copies of a submodule under different names).

We even use it to run CPython's own test suite as "./python -m test".

That said, over in https://bugs.python.org/issue33053#msg314192 I came up with 
a plausible migration path away from doing that implicitly - we'd just have to 
introduce a spelling for doing it explicitly instead, and relative imports give 
us a precedent for that.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35971>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to