diff options
Diffstat (limited to 'Lib/mailbox.py')
-rw-r--r-- | Lib/mailbox.py | 5 |
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.""" |