diff options
| author | Ethan Smith <ethan@ethanhs.me> | 2020-04-13 21:54:40 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-13 21:54:40 -0700 |
| commit | 8ef875028a3644a329c87ce420a73793e315143f (patch) | |
| tree | 102695b9e45519561c88f9d9b91b66992cd40b72 /Lib/_weakrefset.py | |
| parent | cecf049673da6a24435acd1a6a3b34472b323c97 (diff) | |
| download | cpython-git-8ef875028a3644a329c87ce420a73793e315143f.tar.gz | |
bpo-39481: Make weakref and WeakSet generic (GH-19497)
Diffstat (limited to 'Lib/_weakrefset.py')
| -rw-r--r-- | Lib/_weakrefset.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_weakrefset.py b/Lib/_weakrefset.py index 7a84823622..b267780f0c 100644 --- a/Lib/_weakrefset.py +++ b/Lib/_weakrefset.py @@ -3,6 +3,7 @@ # by abc.py to load everything else at startup. from _weakref import ref +from types import GenericAlias __all__ = ['WeakSet'] @@ -197,3 +198,5 @@ class WeakSet: def __repr__(self): return repr(self.data) + + __class_getitem__ = classmethod(GenericAlias) |
