Skip to content

Commit 460158f

Browse files
imaplib: _Authenticator also works with bytearray (#9056)
1 parent d1d1afb commit 460158f

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/imaplib.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import subprocess
22
import sys
33
import time
4-
from _typeshed import ReadableBuffer, Self
4+
from _typeshed import ReadableBuffer, Self, _BufferWithLen
55
from builtins import list as _list # conflicts with a method named "list"
66
from collections.abc import Callable
77
from datetime import datetime
@@ -151,11 +151,11 @@ class IMAP4_stream(IMAP4):
151151
def open(self, host: str | None = ..., port: int | None = ...) -> None: ...
152152

153153
class _Authenticator:
154-
mech: Callable[[bytes], bytes]
155-
def __init__(self, mechinst: Callable[[bytes], bytes]) -> None: ...
154+
mech: Callable[[bytes], bytes | bytearray | memoryview | str | None]
155+
def __init__(self, mechinst: Callable[[bytes], bytes | bytearray | memoryview | str | None]) -> None: ...
156156
def process(self, data: str) -> str: ...
157-
def encode(self, inp: bytes) -> str: ...
158-
def decode(self, inp: str) -> bytes: ...
157+
def encode(self, inp: bytes | bytearray | memoryview) -> str: ...
158+
def decode(self, inp: str | _BufferWithLen) -> bytes: ...
159159

160160
def Internaldate2tuple(resp: ReadableBuffer) -> time.struct_time | None: ...
161161
def Int2AP(num: SupportsAbs[SupportsInt]) -> bytes: ...

0 commit comments

Comments
 (0)