Using '__mul__' within a class

Terry Reedy tjreedy at udel.edu
Sat Sep 24 14:28:28 EDT 2005


"Gerard Flanagan" <grflanagan at yahoo.co.uk> wrote in message 
news:1127576164.489710.291280 at g49g2000cwa.googlegroups.com...
>    def __mul__( self, other ):
>    def Square( self ):
>        self *= self

Among the other reasons cited, I believe that 'op=' maps to a different 
special method than 'op'.  __imul__? or something?  do check.

tjr






More information about the Python-list mailing list