New submission from Daniel Stutzbach <dan...@stutzbachenterprises.com>:

For example, here is one of MutableSet's methods:

    def __isub__(self, it):
        for value in it:
            self.discard(value)
        return self

However, if I do "x -= x", then it mutates my set-like object during iteration, 
which even the built-in set does not support.  ior, iand, and ixor have the 
same problem.

I'm working on running test_set.py (with suitable modifications) on my class 
that derives from collections.MutableSet, so I'm going to be bumping into all 
kinds of fun problems like this.

I'm going to override the methods in my class, and I can contribute my new 
methods back to Python as a patch once they're working.

----------
assignee: stutzbach
components: Library (Lib)
messages: 105974
nosy: stutzbach
priority: normal
severity: normal
stage: unit test needed
status: open
title: Many of MutableSet's methods assume that the other parameter is not self
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue8750>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to