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 ezio.melotti
Recipients docs@python, ethan.furman, ezio.melotti, nedbat, r.david.murray
Date 2015-07-16.07:28:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1437031709.24.0.599521271636.issue24632@psf.upfronthosting.co.za>
In-reply-to
Content
> I think this is due to PEP 420 Namespace Packages.

It works on Python 2 too:
$ ls execdir/
foo.py  __main__.py
$ cat execdir/foo.py 
print("foo imported")
$ cat execdir/__main__.py 
import foo; print("main imported")
$ python execdir/
foo imported
main imported
$ python -V
Python 2.7.8

I haven't done any tests about the interaction of namespace packages and __main__.py, but if there are additional semantics, they should be documented as well.
History
Date User Action Args
2015-07-16 07:28:29ezio.melottisetrecipients: + ezio.melotti, nedbat, r.david.murray, docs@python, ethan.furman
2015-07-16 07:28:29ezio.melottisetmessageid: <1437031709.24.0.599521271636.issue24632@psf.upfronthosting.co.za>
2015-07-16 07:28:29ezio.melottilinkissue24632 messages
2015-07-16 07:28:28ezio.melotticreate