mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
This commit is contained in:
parent
3e7a65f565
commit
38f57a1c75
2 changed files with 28 additions and 4 deletions
|
@ -286,10 +286,9 @@ class MutableSet(Set):
|
|||
self.add(value)
|
||||
return self
|
||||
|
||||
def __iand__(self, c):
|
||||
for value in self:
|
||||
if value not in c:
|
||||
self.discard(value)
|
||||
def __iand__(self, it):
|
||||
for value in (self - it):
|
||||
self.discard(value)
|
||||
return self
|
||||
|
||||
def __ixor__(self, it):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue