mirror of
https://github.com/python/cpython.git
synced 2025-08-22 09:45:06 +00:00
bpo-39481: PEP 585 for dataclasses, mailbox, contextvars (GH-19425)
This commit is contained in:
parent
33986465bd
commit
d01628e411
5 changed files with 24 additions and 14 deletions
|
@ -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."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue