Ehsan Amiri wrote:
> I see the same behaviour, moreover when I change class Quantity to a
> classic class (removing '(object)'), it works as expected. (i.e.
> Quanitity.__add__() is called after the fourth print. I run Python 2.6.2
> on Vista.
Darren found the explanation further down the page he
I see the same behaviour, moreover when I change class Quantity to a classic
class (removing '(object)'), it works as expected. (i.e. Quanitity.__add__()
is called after the fourth print. I run Python 2.6.2 on Vista.
On Sun, Oct 18, 2009 at 7:50 AM, Darren Dale wrote:
> According to http://
On Sun, Oct 18, 2009 at 10:50 AM, Darren Dale wrote:
> According to http://docs.python.org/reference/datamodel.html , the
> reflected operands functions like __radd__ "are only called if the
> left operand does not support the corresponding operation and the
> operands are of different types. [3]
According to http://docs.python.org/reference/datamodel.html , the
reflected operands functions like __radd__ "are only called if the
left operand does not support the corresponding operation and the
operands are of different types. [3] For instance, to evaluate the
expression x - y, where y is an