Multiple constructors

Leif K-Brooks eurleif at ecritters.biz
Sun Feb 6 03:37:19 EST 2005


Leif K-Brooks wrote:
>     @classmethod
>     def from_pair(self, rows, columns):
>         return Matrix([rows, columns]) # Or with the right argument

Er... I'm not sure why I named that argument "self", it should be "cls" 
if you don't want to  confuse anyone reading your code.



More information about the Python-list mailing list