mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-07-10 10:26:31 +08:00
Clean up and fix email message types (#13532)
* Unify the `_MessageT` type var in `email._policybase`. * Use explicit type arguments for `Message` type in `_MessageT` type var. In particular, change bound from `Message[str, str]` to `Message[Any, Any]`. * Change `__init__()` overloads of `Parser` and `BytesParser` to accept `Message` objects that are not `Message[str, str]` if `_class` is not also given.
This commit is contained in:
+1
-1
@@ -4,6 +4,7 @@ import sys
|
||||
from _typeshed import StrPath, SupportsNoArgReadline, SupportsRead
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
|
||||
from email._policybase import _MessageT
|
||||
from types import GenericAlias, TracebackType
|
||||
from typing import IO, Any, AnyStr, Generic, Literal, Protocol, TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
@@ -29,7 +30,6 @@ __all__ = [
|
||||
]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_MessageT = TypeVar("_MessageT", bound=Message)
|
||||
|
||||
class _SupportsReadAndReadline(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user