summaryrefslogtreecommitdiff
path: root/Lib/weakref.py
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2019-11-10 20:12:04 -0800
committerGitHub <noreply@github.com>2019-11-10 20:12:04 -0800
commit84ac4376587e35d16b4d0977c4f330d9d04b690a (patch)
tree68ca88ec65917ab19cca62c3698dd52accf01f3e /Lib/weakref.py
parentaf46450bb97ab9bd38748e75aa849c29fdd70028 (diff)
downloadcpython-git-84ac4376587e35d16b4d0977c4f330d9d04b690a.tar.gz
bpo-38761: Register WeakSet as a MutableSet (GH-17104)
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r--Lib/weakref.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/weakref.py b/Lib/weakref.py
index d17b3ed38e..e3c2ce2d9b 100644
--- a/Lib/weakref.py
+++ b/Lib/weakref.py
@@ -33,6 +33,9 @@ __all__ = ["ref", "proxy", "getweakrefcount", "getweakrefs",
"WeakSet", "WeakMethod", "finalize"]
+_collections_abc.Set.register(WeakSet)
+_collections_abc.MutableSet.register(WeakSet)
+
class WeakMethod(ref):
"""
A custom `weakref.ref` subclass which simulates a weak reference to