[docs] [issue21784] __init__.py can be a directory

Berker Peksag report at bugs.python.org
Tue Jun 17 09:10:53 CEST 2014

Berker Peksag added the comment:

I think this is related to PEP 420.

    $ tree pkg/
    ├── foobar.py

    $ python3.2 -c "from pkg import foobar"
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
    ImportError: No module named pkg

But, with Python 3.3 and newer:

    $ python3.3 -c "from pkg import foobar"

See https://docs.python.org/3/whatsnew/3.3.html#pep-420-implicit-namespace-packages for the whatsnew entry.

nosy: +berker.peksag, eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> pending

Python tracker <report at bugs.python.org>

More information about the docs mailing list