2

Python 3.3 has implicit namespace packages (PEP420) and in Python 2.7 packages can be marked as namespace packages through adding two lines into __init__py. See How do I create a namespace package in python.

Given the features the packages enable, it looks like that new packages should be created as namespace packages by default.

Normal python packages should only be used in exceptional cases where the need for a "closed" package is obvious.

What would be drawback of this approach ?

shuttle87
  • 15,466
  • 11
  • 77
  • 106
JE42
  • 4,881
  • 6
  • 41
  • 51

1 Answers1

0

PEP 420 notes regular packages have a performance advantage:

There is no intention to remove support of regular packages. If a developer knows that her package will never be a portion of a namespace package, then there is a performance advantage to it being a regular package (with an __init__.py). Creation and loading of a regular package can take place immediately when it is located along the path. With namespace packages, all entries in the path must be scanned before the package is created.

paca
  • 11
  • 1