I pip install-ed the flufl.enum Python package and I noticed that it works despite missing a flufl/__init__.py module as regular Python packages. Even stranger is this:
>>> import flufl
>>> flufl
<module 'flufl' (built-in)>
I tried to reproduce this creating foo/bar/__init__.py without foo/__init__.py and (predictably) import foo fails. How does flufl do it?
the magic is done in the flufl.enum-3.2-py2.7-nspkg.pth file, which is put into site-packages by “pip install”:
pth files are evaluated at startup. In particular, this file creates a new module named “flufl” and puts it into sys.modules. That also explains why you see it as “built-in”: