Constraints on __sub__, __eq__, etc.
anfedorov at gmail.com
Thu Feb 18 17:19:02 CET 2010
It seems intuitive to me that the magic methods for overriding the +, -, <,
==, >, etc. operators should have no sideffects on their operands. Also,
that == should be commutative and transitive, that > and < should be
transitive, and anti-commutative.
Is this intuition written up in a PEP, or assumed to follow from the
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-list