[Python-ideas] TypeError: 'module' object is not callable

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Fri Feb 20 06:52:51 CET 2009


I see there have been discussion about module __call__ about three years ago:

http://mail.python.org/pipermail/python-list/2006-February/thread.html#366176

Is there an existing pronouncement on this subject?

__call__ would help avoiding strange things like from StringIO import StringIO
or having to come up with silly names like run, driver, manager, etc.

Ideally, __call__ could be either a function or class.

I imagine, nothing special, except that a module object looks for __call__ instead
of producing a type error.



More information about the Python-ideas mailing list