summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/sets.py2
-rw-r--r--Lib/test/test_sets.py4
2 files changed, 3 insertions, 3 deletions
diff --git a/Lib/sets.py b/Lib/sets.py
index c301c41..0512846 100644
--- a/Lib/sets.py
+++ b/Lib/sets.py
@@ -420,7 +420,7 @@ class Set(BaseSet):
except KeyError:
pass
- def popitem(self):
+ def pop(self):
"""Remove and return a randomly-chosen set element."""
return self._data.popitem()[0]
diff --git a/Lib/test/test_sets.py b/Lib/test/test_sets.py
index 6c72b0e..22a9db5 100644
--- a/Lib/test/test_sets.py
+++ b/Lib/test/test_sets.py
@@ -292,10 +292,10 @@ class TestMutate(unittest.TestCase):
self.set.clear()
assert len(self.set) == 0, "Clearing set"
- def test_popitem(self):
+ def test_pop(self):
popped = {}
while self.set:
- popped[self.set.popitem()] = None
+ popped[self.set.pop()] = None
assert len(popped) == len(self.values), "Popping items"
for v in self.values:
assert v in popped, "Popping items"