8000 imaplib: fix bytes usage (#9021) · python/typeshed@49d3393 · GitHub
[go: up one dir, main page]

Skip to content

Commit 49d3393

Browse files
authored
imaplib: fix bytes usage (#9021)
1 parent b5c4580 commit 49d3393

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

stdlib/imaplib.pyi

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import subprocess
22
import sys
33
import time
4-
from _typeshed import Self
4+
from _typeshed import ReadableBuffer, Self
55
from builtins import list as _list # conflicts with a method named "list"
66
from collections.abc import Callable
77
from datetime import datetime
88
from re import Pattern
99
from socket import socket as _socket
1010
from ssl import SSLContext, SSLSocket
1111
from types import TracebackType
12-
from typing import IO, Any
12+
from typing import IO, Any, SupportsAbs, SupportsInt
1313
from typing_extensions import Literal, TypeAlias
1414

1515
__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]
@@ -54,12 +54,12 @@ class IMAP4:
5454
file: IO[str] | IO[bytes]
5555
def read(self, size: int) -> bytes: ...
5656
def readline(self) -> bytes: ...
57-
def send(self, data: bytes) -> None: ...
57+
def send(self, data: ReadableBuffer) -> None: ...
5858
def shutdown(self) -> None: ...
5959
def socket(self) -> _socket: ...
6060
def recent(self) -> _CommandResults: ...
6161
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: ...
6363
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
6464
def capability(self) -> _CommandResults: ...
6565
def check(self) -> _CommandResults: ...
@@ -157,7 +157,7 @@ class _Authenticator:
157157
def encode(self, inp: bytes) -> str: ...
158158
def decode(self, inp: str) -> bytes: ...
159159

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, ...]: ...
163163
def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ...

0 commit comments

Comments
 (0)
0