mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Big diff: use lower-case list and dict (#5888)
This commit is contained in:
@@ -27,17 +27,17 @@ class TokenList(List[Union[TokenList, Terminal]]):
|
||||
token_type: str | None = ...
|
||||
syntactic_break: bool = ...
|
||||
ew_combine_allowed: bool = ...
|
||||
defects: List[MessageDefect] = ...
|
||||
defects: list[MessageDefect] = ...
|
||||
def __init__(self, *args: Any, **kw: Any) -> None: ...
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
@property
|
||||
def all_defects(self) -> List[MessageDefect]: ...
|
||||
def all_defects(self) -> list[MessageDefect]: ...
|
||||
def startswith_fws(self) -> bool: ...
|
||||
@property
|
||||
def as_ew_allowed(self) -> bool: ...
|
||||
@property
|
||||
def comments(self) -> List[str]: ...
|
||||
def comments(self) -> list[str]: ...
|
||||
def fold(self, *, policy: Policy) -> str: ...
|
||||
def pprint(self, indent: str = ...) -> None: ...
|
||||
def ppstr(self, indent: str = ...) -> str: ...
|
||||
@@ -46,7 +46,7 @@ class WhiteSpaceTokenList(TokenList):
|
||||
@property
|
||||
def value(self) -> str: ...
|
||||
@property
|
||||
def comments(self) -> List[str]: ...
|
||||
def comments(self) -> list[str]: ...
|
||||
|
||||
class UnstructuredTokenList(TokenList):
|
||||
token_type: str = ...
|
||||
@@ -93,46 +93,46 @@ class Comment(WhiteSpaceTokenList):
|
||||
@property
|
||||
def content(self) -> str: ...
|
||||
@property
|
||||
def comments(self) -> List[str]: ...
|
||||
def comments(self) -> list[str]: ...
|
||||
|
||||
class AddressList(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def addresses(self) -> List[Address]: ...
|
||||
def addresses(self) -> list[Address]: ...
|
||||
@property
|
||||
def mailboxes(self) -> List[Mailbox]: ...
|
||||
def mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def all_mailboxes(self) -> List[Mailbox]: ...
|
||||
def all_mailboxes(self) -> list[Mailbox]: ...
|
||||
|
||||
class Address(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def display_name(self) -> str: ...
|
||||
@property
|
||||
def mailboxes(self) -> List[Mailbox]: ...
|
||||
def mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def all_mailboxes(self) -> List[Mailbox]: ...
|
||||
def all_mailboxes(self) -> list[Mailbox]: ...
|
||||
|
||||
class MailboxList(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def mailboxes(self) -> List[Mailbox]: ...
|
||||
def mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def all_mailboxes(self) -> List[Mailbox]: ...
|
||||
def all_mailboxes(self) -> list[Mailbox]: ...
|
||||
|
||||
class GroupList(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def mailboxes(self) -> List[Mailbox]: ...
|
||||
def mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def all_mailboxes(self) -> List[Mailbox]: ...
|
||||
def all_mailboxes(self) -> list[Mailbox]: ...
|
||||
|
||||
class Group(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def mailboxes(self) -> List[Mailbox]: ...
|
||||
def mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def all_mailboxes(self) -> List[Mailbox]: ...
|
||||
def all_mailboxes(self) -> list[Mailbox]: ...
|
||||
@property
|
||||
def display_name(self) -> str: ...
|
||||
|
||||
@@ -145,7 +145,7 @@ class NameAddr(TokenList):
|
||||
@property
|
||||
def domain(self) -> str: ...
|
||||
@property
|
||||
def route(self) -> List[Domain] | None: ...
|
||||
def route(self) -> list[Domain] | None: ...
|
||||
@property
|
||||
def addr_spec(self) -> str: ...
|
||||
|
||||
@@ -156,14 +156,14 @@ class AngleAddr(TokenList):
|
||||
@property
|
||||
def domain(self) -> str: ...
|
||||
@property
|
||||
def route(self) -> List[Domain] | None: ...
|
||||
def route(self) -> list[Domain] | None: ...
|
||||
@property
|
||||
def addr_spec(self) -> str: ...
|
||||
|
||||
class ObsRoute(TokenList):
|
||||
token_type: str = ...
|
||||
@property
|
||||
def domains(self) -> List[Domain]: ...
|
||||
def domains(self) -> list[Domain]: ...
|
||||
|
||||
class Mailbox(TokenList):
|
||||
token_type: str = ...
|
||||
@@ -174,7 +174,7 @@ class Mailbox(TokenList):
|
||||
@property
|
||||
def domain(self) -> str: ...
|
||||
@property
|
||||
def route(self) -> List[str]: ...
|
||||
def route(self) -> list[str]: ...
|
||||
@property
|
||||
def addr_spec(self) -> str: ...
|
||||
|
||||
@@ -326,14 +326,14 @@ class Terminal(str):
|
||||
ew_combine_allowed: bool = ...
|
||||
syntactic_break: bool = ...
|
||||
token_type: str = ...
|
||||
defects: List[MessageDefect] = ...
|
||||
defects: list[MessageDefect] = ...
|
||||
def __new__(cls: Type[_T], value: str, token_type: str) -> _T: ...
|
||||
def pprint(self) -> None: ...
|
||||
@property
|
||||
def all_defects(self) -> List[MessageDefect]: ...
|
||||
def all_defects(self) -> list[MessageDefect]: ...
|
||||
def pop_trailing_ws(self) -> None: ...
|
||||
@property
|
||||
def comments(self) -> List[str]: ...
|
||||
def comments(self) -> list[str]: ...
|
||||
def __getnewargs__(self) -> Tuple[str, str]: ... # type: ignore
|
||||
|
||||
class WhiteSpaceTerminal(Terminal):
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from typing import Any, Iterator, List
|
||||
from typing import Any, Iterator
|
||||
|
||||
QP: int # undocumented
|
||||
BASE64: int # undocumented
|
||||
@@ -15,7 +15,7 @@ class Charset:
|
||||
def get_body_encoding(self) -> str: ...
|
||||
def get_output_charset(self) -> str | None: ...
|
||||
def header_encode(self, string: str) -> str: ...
|
||||
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> List[str]: ...
|
||||
def header_encode_lines(self, string: str, maxlengths: Iterator[int]) -> list[str]: ...
|
||||
def body_encode(self, string: str) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from email.charset import Charset
|
||||
from typing import Any, List, Tuple
|
||||
from typing import Any, Tuple
|
||||
|
||||
class Header:
|
||||
def __init__(
|
||||
@@ -17,9 +17,9 @@ class Header:
|
||||
def __eq__(self, other: Any) -> bool: ...
|
||||
def __ne__(self, other: Any) -> bool: ...
|
||||
|
||||
def decode_header(header: Header | str) -> List[Tuple[bytes, str | None]]: ...
|
||||
def decode_header(header: Header | str) -> list[Tuple[bytes, str | None]]: ...
|
||||
def make_header(
|
||||
decoded_seq: List[Tuple[bytes, str | None]],
|
||||
decoded_seq: list[Tuple[bytes, str | None]],
|
||||
maxlinelen: int | None = ...,
|
||||
header_name: str | None = ...,
|
||||
continuation_ws: str = ...,
|
||||
|
||||
@@ -11,7 +11,7 @@ from email._header_value_parser import (
|
||||
)
|
||||
from email.errors import MessageDefect
|
||||
from email.policy import Policy
|
||||
from typing import Any, Dict, Iterable, Mapping, Tuple, Type
|
||||
from typing import Any, Iterable, Mapping, Tuple, Type
|
||||
|
||||
class BaseHeader(str):
|
||||
@property
|
||||
@@ -28,7 +28,7 @@ class UnstructuredHeader:
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> UnstructuredTokenList: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
|
||||
class UniqueUnstructuredHeader(UnstructuredHeader): ...
|
||||
|
||||
@@ -38,7 +38,7 @@ class DateHeader:
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> UnstructuredTokenList: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str | _datetime, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str | _datetime, kwds: dict[str, Any]) -> None: ...
|
||||
|
||||
class UniqueDateHeader(DateHeader): ...
|
||||
|
||||
@@ -50,7 +50,7 @@ class AddressHeader:
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> AddressList: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
|
||||
class UniqueAddressHeader(AddressHeader): ...
|
||||
|
||||
@@ -70,13 +70,13 @@ class MIMEVersionHeader:
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> MIMEVersion: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
|
||||
class ParameterizedMIMEHeader:
|
||||
@property
|
||||
def params(self) -> Mapping[str, Any]: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
|
||||
class ContentTypeHeader(ParameterizedMIMEHeader):
|
||||
@property
|
||||
@@ -98,7 +98,7 @@ class ContentTransferEncodingHeader:
|
||||
@property
|
||||
def cte(self) -> str: ...
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> ContentTransferEncoding: ...
|
||||
|
||||
@@ -106,7 +106,7 @@ if sys.version_info >= (3, 8):
|
||||
from email._header_value_parser import MessageID
|
||||
class MessageIDHeader:
|
||||
@classmethod
|
||||
def parse(cls, value: str, kwds: Dict[str, Any]) -> None: ...
|
||||
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
|
||||
@staticmethod
|
||||
def value_parser(value: str) -> MessageID: ...
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ class Message:
|
||||
policy: Policy # undocumented
|
||||
preamble: str | None
|
||||
epilogue: str | None
|
||||
defects: List[MessageDefect]
|
||||
defects: list[MessageDefect]
|
||||
def __str__(self) -> str: ...
|
||||
def is_multipart(self) -> bool: ...
|
||||
def set_unixfrom(self, unixfrom: str) -> None: ...
|
||||
@@ -31,11 +31,11 @@ class Message:
|
||||
def __getitem__(self, name: str) -> _HeaderType: ...
|
||||
def __setitem__(self, name: str, val: _HeaderType) -> None: ...
|
||||
def __delitem__(self, name: str) -> None: ...
|
||||
def keys(self) -> List[str]: ...
|
||||
def values(self) -> List[_HeaderType]: ...
|
||||
def items(self) -> List[Tuple[str, _HeaderType]]: ...
|
||||
def keys(self) -> list[str]: ...
|
||||
def values(self) -> list[_HeaderType]: ...
|
||||
def items(self) -> list[Tuple[str, _HeaderType]]: ...
|
||||
def get(self, name: str, failobj: _T = ...) -> _HeaderType | _T: ...
|
||||
def get_all(self, name: str, failobj: _T = ...) -> List[_HeaderType] | _T: ...
|
||||
def get_all(self, name: str, failobj: _T = ...) -> list[_HeaderType] | _T: ...
|
||||
def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ...
|
||||
def replace_header(self, _name: str, _value: _HeaderType) -> None: ...
|
||||
def get_content_type(self) -> str: ...
|
||||
@@ -43,7 +43,7 @@ class Message:
|
||||
def get_content_subtype(self) -> str: ...
|
||||
def get_default_type(self) -> str: ...
|
||||
def set_default_type(self, ctype: str) -> None: ...
|
||||
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> List[Tuple[str, str]] | _T: ...
|
||||
def get_params(self, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> list[Tuple[str, str]] | _T: ...
|
||||
def get_param(self, param: str, failobj: _T = ..., header: str = ..., unquote: bool = ...) -> _T | _ParamType: ...
|
||||
def del_param(self, param: str, header: str = ..., requote: bool = ...) -> None: ...
|
||||
def set_type(self, type: str, header: str = ..., requote: bool = ...) -> None: ...
|
||||
@@ -51,7 +51,7 @@ class Message:
|
||||
def get_boundary(self, failobj: _T = ...) -> _T | str: ...
|
||||
def set_boundary(self, boundary: str) -> None: ...
|
||||
def get_content_charset(self, failobj: _T = ...) -> _T | str: ...
|
||||
def get_charsets(self, failobj: _T = ...) -> _T | List[str]: ...
|
||||
def get_charsets(self, failobj: _T = ...) -> _T | list[str]: ...
|
||||
def walk(self) -> Generator[Message, None, None]: ...
|
||||
def get_content_disposition(self) -> str | None: ...
|
||||
def as_string(self, unixfrom: bool = ..., maxheaderlen: int = ..., policy: Policy | None = ...) -> str: ...
|
||||
|
||||
@@ -3,7 +3,7 @@ from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
from email.message import Message
|
||||
from typing import Any, Callable, List, Tuple
|
||||
from typing import Any, Callable, Tuple
|
||||
|
||||
class Policy:
|
||||
max_line_length: int | None
|
||||
@@ -17,7 +17,7 @@ class Policy:
|
||||
def register_defect(self, obj: Message, defect: MessageDefect) -> None: ...
|
||||
def header_max_count(self, name: str) -> int | None: ...
|
||||
@abstractmethod
|
||||
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
|
||||
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
|
||||
@abstractmethod
|
||||
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
|
||||
@abstractmethod
|
||||
@@ -28,7 +28,7 @@ class Policy:
|
||||
def fold_binary(self, name: str, value: str) -> bytes: ...
|
||||
|
||||
class Compat32(Policy):
|
||||
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
|
||||
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
|
||||
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str | Header: ... # type: ignore
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
@@ -41,7 +41,7 @@ class EmailPolicy(Policy):
|
||||
refold_source: str
|
||||
header_factory: Callable[[str, str], str]
|
||||
content_manager: ContentManager
|
||||
def header_source_parse(self, sourcelines: List[str]) -> Tuple[str, str]: ...
|
||||
def header_source_parse(self, sourcelines: list[str]) -> Tuple[str, str]: ...
|
||||
def header_store_parse(self, name: str, value: str) -> Tuple[str, str]: ...
|
||||
def header_fetch_parse(self, name: str, value: str) -> str: ...
|
||||
def fold(self, name: str, value: str) -> str: ...
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import datetime
|
||||
import sys
|
||||
from email.charset import Charset
|
||||
from typing import List, Optional, Tuple, Union, overload
|
||||
from typing import Optional, Tuple, Union, overload
|
||||
|
||||
_ParamType = Union[str, Tuple[Optional[str], Optional[str], str]]
|
||||
_PDTZ = Tuple[int, int, int, int, int, int, int, int, int, Optional[int]]
|
||||
@@ -10,7 +10,7 @@ def quote(str: str) -> str: ...
|
||||
def unquote(str: str) -> str: ...
|
||||
def parseaddr(addr: str | None) -> Tuple[str, str]: ...
|
||||
def formataddr(pair: Tuple[str | None, str], charset: str | Charset = ...) -> str: ...
|
||||
def getaddresses(fieldvalues: List[str]) -> List[Tuple[str, str]]: ...
|
||||
def getaddresses(fieldvalues: list[str]) -> list[Tuple[str, str]]: ...
|
||||
@overload
|
||||
def parsedate(data: None) -> None: ...
|
||||
@overload
|
||||
@@ -37,4 +37,4 @@ def make_msgid(idstring: str | None = ..., domain: str | None = ...) -> str: ...
|
||||
def decode_rfc2231(s: str) -> Tuple[str | None, str | None, str]: ...
|
||||
def encode_rfc2231(s: str, charset: str | None = ..., language: str | None = ...) -> str: ...
|
||||
def collapse_rfc2231_value(value: _ParamType, errors: str = ..., fallback_charset: str = ...) -> str: ...
|
||||
def decode_params(params: List[Tuple[str, str]]) -> List[Tuple[str, _ParamType]]: ...
|
||||
def decode_params(params: list[Tuple[str, str]]) -> list[Tuple[str, _ParamType]]: ...
|
||||
|
||||
Reference in New Issue
Block a user