Skip to content

Commit 82bf494

Browse files
quopri: improve types (#9074)
1 parent 22c5afa commit 82bf494

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

stdlib/quopri.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
from typing import BinaryIO
1+
from _typeshed import ReadableBuffer, SupportsNoArgReadline, SupportsRead, SupportsWrite
2+
from typing import Protocol
23

34
__all__ = ["encode", "decode", "encodestring", "decodestring"]
45

5-
def encode(input: BinaryIO, output: BinaryIO, quotetabs: int, header: int = ...) -> None: ...
6-
def encodestring(s: bytes, quotetabs: int = ..., header: int = ...) -> bytes: ...
7-
def decode(input: BinaryIO, output: BinaryIO, header: int = ...) -> None: ...
8-
def decodestring(s: bytes, header: int = ...) -> bytes: ...
6+
class _Input(SupportsRead[bytes], SupportsNoArgReadline[bytes], Protocol): ...
7+
8+
def encode(input: _Input, output: SupportsWrite[bytes], quotetabs: int, header: int = ...) -> None: ...
9+
def encodestring(s: ReadableBuffer, quotetabs: int = ..., header: int = ...) -> bytes: ...
10+
def decode(input: _Input, output: SupportsWrite[bytes], header: int = ...) -> None: ...
11+
def decodestring(s: str | ReadableBuffer, header: int = ...) -> bytes: ...

0 commit comments

Comments
 (0)