Is __mul__ sufficient for operator '*'?

Mick Krippendorf mad.mick at gmx.de
Tue Oct 20 08:18:01 EDT 2009


Gabriel Genellina schrieb:
> http://docs.python.org/reference/datamodel.html#special-method-lookup-for-new-style-classes
Ok. That explains a lot. And your explanation tells the rest. Thank you.

> In short, you have to define the __mul__ method on the type itself or
> any of its bases.
I found this, where Raymond Hettinger shows how this could be changed:
http://mail.python.org/pipermail/python-bugs-list/2005-December/031439.html

Mick.



More information about the Python-list mailing list