overload operator()?

Peter Hansen peter at engcorp.com
Mon Dec 16 15:23:34 EST 2002


Bruce Dickey wrote:
> 
> Is there a way to overload () in Python to call a user-defined function?
> I've overloaded + | ~ etc, but () has me stumped.

You probably want the __call__ special method.

-Peter



More information about the Python-list mailing list