mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
bpo-36949: Implement __repr__ on WeakSet (GH-13415)
This commit is contained in:
parent
77b3b7701a
commit
5ae1c84bcd
3 changed files with 7 additions and 0 deletions
|
|
@ -194,3 +194,6 @@ def union(self, other):
|
|||
|
||||
def isdisjoint(self, other):
|
||||
return len(self.intersection(other)) == 0
|
||||
|
||||
def __repr__(self):
|
||||
return repr(self.data)
|
||||
|
|
|
|||
|
|
@ -434,6 +434,9 @@ def test_len_race(self):
|
|||
self.assertGreaterEqual(n2, 0)
|
||||
self.assertLessEqual(n2, n1)
|
||||
|
||||
def test_repr(self):
|
||||
assert repr(self.s) == repr(self.s.data)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Implement __repr__ for WeakSet objects.
|
||||
Loading…
Add table
Add a link
Reference in a new issue