summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.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/mailbox.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/mailbox.py')
-rw-r--r--Lib/mailbox.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 5b4e864..70da07e 100644
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -18,6 +18,7 @@ import email.message
import email.generator
import io
import contextlib
+from types import GenericAlias
try:
import fcntl
except ImportError:
@@ -260,6 +261,8 @@ class Mailbox:
else:
raise TypeError('Invalid message type: %s' % type(message))
+ __class_getitem__ = classmethod(GenericAlias)
+
class Maildir(Mailbox):
"""A qmail-style Maildir mailbox."""
@@ -2015,6 +2018,8 @@ class _ProxyFile:
return False
return self._file.closed
+ __class_getitem__ = classmethod(GenericAlias)
+
class _PartialFile(_ProxyFile):
"""A read-only wrapper of part of a file."""