collections.Set Binary Reflected Operations

Daniel Urban urban.dani at gmail.com
Thu Jan 20 01:02:21 EST 2011


On Thu, Jan 20, 2011 at 01:51, Chris Kaynor <ckaynor at zindagigames.com> wrote:
> 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

See http://bugs.python.org/issue8743 and also http://bugs.python.org/issue2226


Daniel



More information about the Python-list mailing list