operator overloading + - / * = etc...

Sybren Stuvel sybrenUSE at YOURthirdtower.com.imagination
Sat Oct 7 23:32:01 CEST 2006

SpreadTooThin enlightened us with:
> Can these operators be overloaded?


> If so.  How?

Implement __add__, __sub__ etc. in the class that you want to be able
to add, subtract, etc.

Sybren Stüvel
Stüvel IT - http://www.stuvel.eu/

More information about the Python-list mailing list