functors

Erik Max Francis max at alcyone.com
Tue Jul 1 22:22:12 EDT 2003


Tom Plunket wrote:

> I wouldn't mind creating a new class to wrap this up (that's what
> I'd do in C++, and that class would have an operator() defined),
> but I can't seem to discover how to make callable objects in
> Python.

The __call__ method is the equivalent of C++'s operator ().

-- 
   Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
 __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
/  \ Sometimes there's no point in giving up.
\__/  Louis Wu




More information about the Python-list mailing list