[issue2226] Small _abcoll Bugs / Oddities

Daniel Stutzbach report at bugs.python.org
Wed Dec 15 01:55:07 CET 2010


Daniel Stutzbach <stutzbach at google.com> added the comment:

Minor point of clarity: you mean __rand__ not __radd__, right?  Set objects do not support addition at all.

Adding the __rand__ methods to collections.Set in and of itself is straightforward:

    def __rsub__(self, other):
        return self._from_iterable(other) - self
    __ror__ = __or__
    __rand__ = __and__
    __rxor__ = __xor__

I'm not sure I understand the can of worms.  While replacing concrete tests with abstract tests may be worthwhile goal in its own right, why is it necessary to solve the particular shortcoming of missing __r* methods?

Probably I'm missing something.  With just the minimal change above, what kinds of things do you expect to fail?

(assuming Issue8743 is also fixed)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue2226>
_______________________________________


More information about the Python-bugs-list mailing list