[Python-ideas] Simpler namespace packages

Mike Graham mikegraham at gmail.com
Mon Jun 20 16:03:57 CEST 2011


I was reading over PEP 382 and am not sure I really understand how it
is a worthwhile step forward. Namespace packages are currently a mess
and personally if anyone asks me I recommend not using the
currently-available approach at all.

Would it be possible to allow a more simple definition, for example
putting the dot itself in the filename? Where these would be similar?

site-packages/
    foo/
        __init__.py
    foo.bar.py
    foo.baz/
        __init__.py
        qux.py
     foo.spam.eggs.py

and

site-packages/
    foo/
        __init__.py
        bar.py
        baz/
            __init__.py
            qux.py
        spam/
            __init__.py #empty
            eggs.py

Obviously this is not fully-defined, but would this kind of approach
fill the same need and be nicer to use, create, find, and understand
then what is proposed in PEP 382?



More information about the Python-ideas mailing list