collections.Set Binary Reflected Operations

Chris Kaynor ckaynor at zindagigames.com
Wed Jan 19 19:51:23 EST 2011


I am implemented a custom set-like type which interacts with some
third-party software when retrieving and mutating the set, and have derived
my custom type off of collections.MutableSet, however I have noticed that
some of the magic methods supported by the built-in set do not fully
function with my custom type. From this, I looked over the
MutableSet definition in and it seems to be missing all of the reflected
operators (__rsub__, __rand__, __ror__, __rxor__, and friends) for the
operators it has defined. I can post a simple example case if desired.

I am using Python 2.6.4 (with some in-house customizations), however a quick
look over the svn repository shown on python.org makes it appear that these
are also not implemented in Python 3. I was wondering if there is some
reason for this, or if it was merely an oversight.

Chris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20110119/a9fa50ab/attachment.html>


More information about the Python-list mailing list