We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e624d17 commit bf93b04Copy full SHA for bf93b04
Lib/_weakrefset.py
@@ -41,7 +41,10 @@ def copy(self):
41
42
def pop(self):
43
while True:
44
- itemref = self.data.pop()
+ try:
45
+ itemref = self.data.pop()
46
+ except KeyError:
47
+ raise KeyError('pop from empty WeakSet')
48
item = itemref()
49
if item is not None:
50
return item
@@ -107,5 +110,5 @@ def symmetric_difference_update(self, other):
107
110
__ixor__ = symmetric_difference_update
108
111
109
112
def union(self, other):
- self._apply_mutate(other, self.data.union)
113
+ return self._apply(other, self.data.union)
114
__or__ = union
0 commit comments