PEP-3141 outlines an approach to writing binary operators to allow the
right operand to override the operation if the left operand inherits
the operation from the ABC.
Here is my first approximation at how to write them for the Integral mixins:
class Integral(Rational):
def __and__(self, oth
Raymond Hettinger wrote:
> PEP-3141 outlines an approach to writing binary
> operators to allow the right operand to override
> the operation if the left operand inherits the
> operation from the ABC.
> Here is my first approximation at how to write
> them for the Integral mixins:
> class Integr
Raymond Hettinger wrote:
The question for the group is what to put on the XXX line.
1. Limit it to type(self). This approach claims the least knowledge
about other types and uses their __rand__ methods().
2. Use type(self), int, and long. This approach says that we know that
ints and longs