Using '__mul__' within a class

Ivan Voras ivoras at __yahoo.org__
Sat Sep 24 12:44:34 EDT 2005


Gerard Flanagan wrote:

>     def Square( self ):
>         self *= self

You probably mean
           return self * self

> A = FibonacciMatrix()
> A.Square()

Make this
A = A.Square()



More information about the Python-list mailing list