Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions stdlib/@tests/test_cases/check_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
assert_type(codecs.decode(b"x", "unicode-escape"), str)

assert_type(codecs.decode(b"x", "utf-8"), str)
assert_type(codecs.lookup("UTF-8").decode(b"potato", errors="replace"), tuple[str, int])
codecs.decode("x", "utf-8") # type: ignore

assert_type(codecs.decode("ab", "hex"), bytes)
Expand Down
2 changes: 1 addition & 1 deletion stdlib/codecs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class _Encoder(Protocol):

@type_check_only
class _Decoder(Protocol):
def __call__(self, input: ReadableBuffer, errors: str = ..., /) -> tuple[str, int]: ... # signature of Codec().decode
def __call__(self, input: ReadableBuffer, /, errors: str = ...) -> tuple[str, int]: ... # signature of Codec().decode

@type_check_only
class _StreamReader(Protocol):
Expand Down
Loading