diff options
| author | Ethan Smith <ethan@ethanhs.me> | 2020-04-14 16:14:15 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-14 16:14:15 -0700 |
| commit | d01628e411752ee6849f862cae66a1c69fe512b7 (patch) | |
| tree | 4b6fc066cc0dc4c1aa2352896d81c0573e5a9138 /Lib/dataclasses.py | |
| parent | 33986465bde2a2188537c4ef6cdb6055e348f31f (diff) | |
| download | cpython-git-d01628e411752ee6849f862cae66a1c69fe512b7.tar.gz | |
bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)
Diffstat (limited to 'Lib/dataclasses.py')
| -rw-r--r-- | Lib/dataclasses.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py index 00851c648a..fc69508354 100644 --- a/Lib/dataclasses.py +++ b/Lib/dataclasses.py @@ -7,6 +7,7 @@ import keyword import builtins import functools import _thread +from types import GenericAlias __all__ = ['dataclass', @@ -284,6 +285,8 @@ class Field: # it. func(self.default, owner, name) + __class_getitem__ = classmethod(GenericAlias) + class _DataclassParams: __slots__ = ('init', |
