Update _weakrefset.py from 3.13.5 (#6004)

* Update `_weakrefset` from 3.13.5

* Update `test_weakset.py` from 3.13.5
This commit is contained in:
Shahar Naveh authored and GitHub committed 2025-07-20 10:33:22 +09:00
1 parent 9739592798
commit 4f9dd41041
2 files changed
+2 -5

No files matched your search

+1 -2
View File
@@ -80,8 +80,7 @@ class WeakSet:
return wr in self.data
def __reduce__(self):
return (self.__class__, (list(self),),
getattr(self, '__dict__', None))
return self.__class__, (list(self),), self.__getstate__()
def add(self, item):
if self._pending_removals:
+1 -3
View File
@@ -44,7 +44,7 @@ class TestWeakSet(unittest.TestCase):
def test_methods(self):
weaksetmethods = dir(WeakSet)
for method in dir(set):
if method == 'test_c_api' or method.startswith('_'):
if method.startswith('_'):
continue
self.assertIn(method, weaksetmethods,
"WeakSet missing method " + method)
@@ -458,8 +458,6 @@ class TestWeakSet(unittest.TestCase):
self.assertIsInstance(self.s, Set)
self.assertIsInstance(self.s, MutableSet)
# TODO: RUSTPYTHON
@unittest.expectedFailure
def test_copying(self):
for cls in WeakSet, WeakSetWithSlots:
s = cls(self.items)