overload operator()?

Gonçalo Rodrigues op73418 at mail.telepac.pt
Mon Dec 16 15:28:16 EST 2002


On Mon, 16 Dec 2002 12:59:27 -0700, "Bruce Dickey"
<brucedickey at micron.com> wrote:

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

Check up the __call__ magic method in the docs. It might be just what
you want.

All the best,
G. Rodrigues




More information about the Python-list mailing list