commit | 38f57a1c757630c248ff139a9f123df32931c357 | [log] [tgz] |
---|---|---|
author | Raymond Hettinger <python@rcn.com> | Wed Apr 01 18:55:57 2009 +0000 |
committer | Raymond Hettinger <python@rcn.com> | Wed Apr 01 18:55:57 2009 +0000 |
tree | 596a12082f7828944d2408c38517fbde2cc38996 | |
parent | 3e7a65f5650e5162851a6e9b05121bd49f8f07e2 [diff] [blame] |
Issue #5647: MutableSet.__iand__() no longer mutates self during iteration.
diff --git a/Lib/_abcoll.py b/Lib/_abcoll.py index 942a72c..a355be9 100644 --- a/Lib/_abcoll.py +++ b/Lib/_abcoll.py
@@ -286,10 +286,9 @@ 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):