assignment to __class__ (was Re: Copy constructors)

Guido van Rossum guido at python.org
Tue Aug 14 00:32:53 CEST 2001


> Python programmers use the following idiom:
> 
> class A:
>   # ...
>   def __mul__(self, other):
>     ...
>   __rmul__ = __mul__
> 
> 
> If I understood correctly, __rmul__ will be of different
> category from __mul__? This causes asymmetry...

Sorry, you must have misunderstood.  They will be the same.

--Guido van Rossum (home page: http://www.python.org/~guido/)




More information about the Python-list mailing list