PEP 713: Callable Modules
Modules are currently not directly callable. Classes can define a __call__ method that makes instance objects callable, but defining a similarly named function in the global module scope has no effect, and that function can only be called by importing or referencing it directly as module.__call__. PEP 562 added support for :meth:`~object.__getattr__` and :meth:`~object.__dir__` for modules, but defining __getattr__ to return a value for __call__ still does not make a module callab … ⌘ Read more