mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-38761: Register WeakSet as a MutableSet (GH-17104)
This commit is contained in:
parent
af46450bb9
commit
84ac437658
3 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue