mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-08 20:43:25 +08:00
Avoid using string literals in type annotations (#2294)
This commit is contained in:
committed by
Jelle Zijlstra
parent
25ad95de4f
commit
6192cce9d9
@@ -5,7 +5,7 @@ from email.message import Message
|
||||
from email.policy import Policy
|
||||
|
||||
class Generator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
@@ -14,7 +14,7 @@ class Generator:
|
||||
linesep: Optional[str] =...) -> None: ...
|
||||
|
||||
class BytesGenerator:
|
||||
def clone(self, fp: TextIO) -> 'Generator': ...
|
||||
def clone(self, fp: TextIO) -> Generator: ...
|
||||
def write(self, s: str) -> None: ...
|
||||
def __init__(self, outfp: TextIO, mangle_from_: bool = ...,
|
||||
maxheaderlen: int = ..., *,
|
||||
|
||||
@@ -12,7 +12,7 @@ class BaseHeader(str):
|
||||
def defects(self) -> Tuple[MessageDefect, ...]: ...
|
||||
@property
|
||||
def max_count(self) -> Optional[int]: ...
|
||||
def __new__(cls, name: str, value: Any) -> 'BaseHeader': ...
|
||||
def __new__(cls, name: str, value: Any) -> BaseHeader: ...
|
||||
def init(self, *args: Any, **kw: Any) -> None: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class Message:
|
||||
def is_multipart(self) -> bool: ...
|
||||
def set_unixfrom(self, unixfrom: str) -> None: ...
|
||||
def get_unixfrom(self) -> Optional[str]: ...
|
||||
def attach(self, payload: 'Message') -> None: ...
|
||||
def attach(self, payload: Message) -> None: ...
|
||||
def get_payload(self, i: int = ..., decode: bool = ...) -> Optional[_PayloadType]: ...
|
||||
def set_payload(self, payload: _PayloadType,
|
||||
charset: _CharsetType = ...) -> None: ...
|
||||
@@ -62,7 +62,7 @@ class Message:
|
||||
def set_boundary(self, boundary: str) -> None: ...
|
||||
def get_content_charset(self, failobj: _T = ...) -> Union[_T, str]: ...
|
||||
def get_charsets(self, failobj: _T = ...) -> Union[_T, List[str]]: ...
|
||||
def walk(self) -> Generator['Message', None, None]: ...
|
||||
def walk(self) -> Generator[Message, None, None]: ...
|
||||
if sys.version_info >= (3, 5):
|
||||
def get_content_disposition(self) -> Optional[str]: ...
|
||||
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ...,
|
||||
|
||||
@@ -16,7 +16,7 @@ class Policy:
|
||||
if sys.version_info >= (3, 5):
|
||||
mange_from = ... # type: bool
|
||||
def __init__(self, **kw: Any) -> None: ...
|
||||
def clone(self, **kw: Any) -> 'Policy': ...
|
||||
def clone(self, **kw: Any) -> Policy: ...
|
||||
def handle_defect(self, obj: Message,
|
||||
defect: MessageDefect) -> None: ...
|
||||
def register_defect(self, obj: Message,
|
||||
|
||||
Reference in New Issue
Block a user