|
1 | 1 | import subprocess
|
2 | 2 | import sys
|
3 | 3 | import time
|
4 |
| -from _typeshed import Self |
| 4 | +from _typeshed import ReadableBuffer, Self |
5 | 5 | from builtins import list as _list # conflicts with a method named "list"
|
6 | 6 | from collections.abc import Callable
|
7 | 7 | from datetime import datetime
|
8 | 8 | from re import Pattern
|
9 | 9 | from socket import socket as _socket
|
10 | 10 | from ssl import SSLContext, SSLSocket
|
11 | 11 | from types import TracebackType
|
12 |
| -from typing import IO, Any |
| 12 | +from typing import IO, Any, SupportsAbs, SupportsInt |
13 | 13 | from typing_extensions import Literal, TypeAlias
|
14 | 14 |
|
15 | 15 | __all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]
|
@@ -54,12 +54,12 @@ class IMAP4:
|
54 | 54 | file: IO[str] | IO[bytes]
|
55 | 55 | def read(self, size: int) -> bytes: ...
|
56 | 56 | def readline(self) -> bytes: ...
|
57 |
| - def send(self, data: bytes) -> None: ... |
| 57 | + def send(self, data: ReadableBuffer) -> None: ... |
58 | 58 | def shutdown(self) -> None: ...
|
59 | 59 | def socket(self) -> _socket: ...
|
60 | 60 | def recent(self) -> _CommandResults: ...
|
61 | 61 | def response(self, code: str) -> _CommandResults: ...
|
62 |
| - def append(self, mailbox: str, flags: str, date_time: str, message: bytes) -> str: ... |
| 62 | + def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> str: ... |
63 | 63 | def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
|
64 | 64 | def capability(self) -> _CommandResults: ...
|
65 | 65 | def check(self) -> _CommandResults: ...
|
@@ -157,7 +157,7 @@ class _Authenticator:
|
157 | 157 | def encode(self, inp: bytes) -> str: ...
|
158 | 158 | def decode(self, inp: str) -> bytes: ...
|
159 | 159 |
|
160 |
| -def Internaldate2tuple(resp: bytes) -> time.struct_time: ... |
161 |
| -def Int2AP(num: int) -> str: ... |
162 |
| -def ParseFlags(resp: bytes) -> tuple[bytes, ...]: ... |
| 160 | +def Internaldate2tuple(resp: ReadableBuffer) -> time.struct_time | None: ... |
| 161 | +def Int2AP(num: SupportsAbs[SupportsInt]) -> bytes: ... |
| 162 | +def ParseFlags(resp: ReadableBuffer) -> tuple[bytes, ...]: ... |
163 | 163 | def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ...
|
0 commit comments