summaryrefslogtreecommitdiffstats
path: root/Lib/dataclasses.py
diff options
context:
space:
mode:
authorEthan Smith <ethan@ethanhs.me>2020-04-14 23:14:15 (GMT)
committerGitHub <noreply@github.com>2020-04-14 23:14:15 (GMT)
commitd01628e411752ee6849f862cae66a1c69fe512b7 (patch)
tree4b6fc066cc0dc4c1aa2352896d81c0573e5a9138 /Lib/dataclasses.py
parent33986465bde2a2188537c4ef6cdb6055e348f31f (diff)
downloadcpython-d01628e411752ee6849f862cae66a1c69fe512b7.zip
cpython-d01628e411752ee6849f862cae66a1c69fe512b7.tar.gz
cpython-d01628e411752ee6849f862cae66a1c69fe512b7.tar.bz2
bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)
Diffstat (limited to 'Lib/dataclasses.py')
-rw-r--r--Lib/dataclasses.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/dataclasses.py b/Lib/dataclasses.py
index 00851c6..fc69508 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',