bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)

This commit is contained in:
Ethan Smith 2020-04-14 16:14:15 -07:00 committed by GitHub
parent 33986465bd
commit d01628e411
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 14 deletions

View file

@ -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."""