Callable modules?

Erno Kuusela erno-news at erno.iki.fi
Tue Jul 23 03:18:24 EDT 2002


In article <7xu1mr7jmr.fsf at ruckus.brouhaha.com>, Paul Rubin
<phr-n2002b at NOSPAMnightsong.com> writes:

| Does that reasoning not also apply to class instances?  Why should
| class instances be callable through the __call__ method?

you have to use __call__ (and not pass a bound method) when you
pass something out as a callback, but still want to be able to
do other things with the object when you get one back.

in most other situations it is better to just use a normal method,
in my opinion.

  -- erno



More information about the Python-list mailing list