diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2019-11-10 20:12:04 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-10 20:12:04 -0800 |
commit | 84ac4376587e35d16b4d0977c4f330d9d04b690a (patch) | |
tree | 68ca88ec65917ab19cca62c3698dd52accf01f3e /Lib/weakref.py | |
parent | af46450bb97ab9bd38748e75aa849c29fdd70028 (diff) | |
download | cpython-git-84ac4376587e35d16b4d0977c4f330d9d04b690a.tar.gz |
bpo-38761: Register WeakSet as a MutableSet (GH-17104)
Diffstat (limited to 'Lib/weakref.py')
-rw-r--r-- | Lib/weakref.py | 3 |
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 |