En Mon, 19 Oct 2009 21:31:44 -0300, Muhammad Alkarouri <malkaro...@gmail.com> escribió:

I was having a go at a simple implementation of Maybe in Python when I
stumbled on a case where x.__mul__(y) is defined while x*y is not.

__special__ methods are searched in the type, not in the instance directly. x*y looks for type(x).__mul__ (among other things)


--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to