mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-02 17:43:25 +08:00
check_new_syntax.py: check nested annotations (#6167)
This commit is contained in:
@@ -14,6 +14,8 @@ _CommandResults = Tuple[str, List[Any]]
|
||||
|
||||
_AnyResponseData = Union[List[None], List[Union[bytes, Tuple[bytes, bytes]]]]
|
||||
|
||||
_list = list # conflicts with a method named "list"
|
||||
|
||||
class IMAP4:
|
||||
error: Type[Exception]
|
||||
abort: Type[Exception]
|
||||
@@ -22,8 +24,8 @@ class IMAP4:
|
||||
debug: int
|
||||
state: str
|
||||
literal: str | None
|
||||
tagged_commands: dict[bytes, List[bytes] | None]
|
||||
untagged_responses: dict[str, List[bytes | Tuple[bytes, bytes]]]
|
||||
tagged_commands: dict[bytes, _list[bytes] | None]
|
||||
untagged_responses: dict[str, _list[bytes | Tuple[bytes, bytes]]]
|
||||
continuation_response: str
|
||||
is_readonly: bool
|
||||
tagnum: int
|
||||
@@ -69,23 +71,23 @@ class IMAP4:
|
||||
def getquota(self, root: str) -> _CommandResults: ...
|
||||
def getquotaroot(self, mailbox: str) -> _CommandResults: ...
|
||||
def list(self, directory: str = ..., pattern: str = ...) -> Tuple[str, _AnyResponseData]: ...
|
||||
def login(self, user: str, password: str) -> Tuple[Literal["OK"], List[bytes]]: ...
|
||||
def login(self, user: str, password: str) -> Tuple[Literal["OK"], _list[bytes]]: ...
|
||||
def login_cram_md5(self, user: str, password: str) -> _CommandResults: ...
|
||||
def logout(self) -> Tuple[str, _AnyResponseData]: ...
|
||||
def lsub(self, directory: str = ..., pattern: str = ...) -> _CommandResults: ...
|
||||
def myrights(self, mailbox: str) -> _CommandResults: ...
|
||||
def namespace(self) -> _CommandResults: ...
|
||||
def noop(self) -> Tuple[str, List[bytes]]: ...
|
||||
def noop(self) -> Tuple[str, _list[bytes]]: ...
|
||||
def partial(self, message_num: str, message_part: str, start: str, length: str) -> _CommandResults: ...
|
||||
def proxyauth(self, user: str) -> _CommandResults: ...
|
||||
def rename(self, oldmailbox: str, newmailbox: str) -> _CommandResults: ...
|
||||
def search(self, charset: str | None, *criteria: str) -> _CommandResults: ...
|
||||
def select(self, mailbox: str = ..., readonly: bool = ...) -> Tuple[str, List[bytes | None]]: ...
|
||||
def select(self, mailbox: str = ..., readonly: bool = ...) -> Tuple[str, _list[bytes | None]]: ...
|
||||
def setacl(self, mailbox: str, who: str, what: str) -> _CommandResults: ...
|
||||
def setannotation(self, *args: str) -> _CommandResults: ...
|
||||
def setquota(self, root: str, limits: str) -> _CommandResults: ...
|
||||
def sort(self, sort_criteria: str, charset: str, *search_criteria: str) -> _CommandResults: ...
|
||||
def starttls(self, ssl_context: Any | None = ...) -> Tuple[Literal["OK"], List[None]]: ...
|
||||
def starttls(self, ssl_context: Any | None = ...) -> Tuple[Literal["OK"], _list[None]]: ...
|
||||
def status(self, mailbox: str, names: str) -> _CommandResults: ...
|
||||
def store(self, message_set: str, command: str, flags: str) -> _CommandResults: ...
|
||||
def subscribe(self, mailbox: str) -> _CommandResults: ...
|
||||
|
||||
@@ -38,7 +38,7 @@ class MapResult(ApplyResult[List[_T]]):
|
||||
pool: Pool,
|
||||
chunksize: int,
|
||||
length: int,
|
||||
callback: Callable[[List[_T]], None] | None,
|
||||
callback: Callable[[list[_T]], None] | None,
|
||||
error_callback: Callable[[BaseException], None] | None,
|
||||
) -> None: ...
|
||||
else:
|
||||
@@ -47,7 +47,7 @@ class MapResult(ApplyResult[List[_T]]):
|
||||
cache: dict[int, ApplyResult[Any]],
|
||||
chunksize: int,
|
||||
length: int,
|
||||
callback: Callable[[List[_T]], None] | None,
|
||||
callback: Callable[[list[_T]], None] | None,
|
||||
error_callback: Callable[[BaseException], None] | None,
|
||||
) -> None: ...
|
||||
|
||||
|
||||
@@ -12,6 +12,8 @@ CR: bytes
|
||||
LF: bytes
|
||||
CRLF: bytes
|
||||
|
||||
_list = list # conflicts with a method named "list"
|
||||
|
||||
class POP3:
|
||||
encoding: str
|
||||
host: str
|
||||
@@ -41,7 +43,7 @@ class POP3:
|
||||
@overload
|
||||
def uidl(self, which: Any) -> bytes: ...
|
||||
def utf8(self) -> bytes: ...
|
||||
def capa(self) -> dict[str, List[str]]: ...
|
||||
def capa(self) -> dict[str, _list[str]]: ...
|
||||
def stls(self, context: ssl.SSLContext | None = ...) -> bytes: ...
|
||||
|
||||
class POP3_SSL(POP3):
|
||||
|
||||
Reference in New Issue
Block a user