This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients Gabriel Corona, eric.snow, ncoghlan, ronaldoussoren, vstinner, xtreak
Date 2019-02-16.17:47:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550339259.7.0.667623393192.issue35971@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2019-02-16 17:47:39ncoghlansetrecipients: + ncoghlan, ronaldoussoren, vstinner, eric.snow, Gabriel Corona, xtreak
2019-02-16 17:47:39ncoghlansetmessageid: <1550339259.7.0.667623393192.issue35971@roundup.psfhosted.org>
2019-02-16 17:47:39ncoghlanlinkissue35971 messages
2019-02-16 17:47:39ncoghlancreate