PEP 713: Callable Modules

Yes, aside from the occasional minor convenience, mostly this will just mess with people’s mental model of Python. Currently, there is a huge and easy to explain difference between import pprint and from pprint import pprint.

This PEP will put code reviewer in the awkward position of having to remember which modules have the call capability and remembering which version of Python that capability was added. For example, when is this code correct, import pprint; pprint(dir()).

Also, the premise that modules have only one principal capability is dubious. A module may start that way but can grow over time.

There is also the matter of spelling. We typically capitalize class names while lower casing function names. This is a problem for cases like the graphlib module that only features TopologicalSorter. We really don’t want instantiation with ts = graphlib(*args). That would appear too much like a function call.