mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
io, codecs: improve bytes handling (#9059)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import types
|
||||
from _typeshed import Self
|
||||
from _typeshed import ReadableBuffer, Self
|
||||
from abc import abstractmethod
|
||||
from collections.abc import Callable, Generator, Iterable
|
||||
from typing import Any, BinaryIO, Protocol, TextIO
|
||||
@@ -173,7 +173,7 @@ class IncrementalDecoder:
|
||||
errors: str
|
||||
def __init__(self, errors: str = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def decode(self, input: bytes, final: bool = ...) -> str: ...
|
||||
def decode(self, input: ReadableBuffer, final: bool = ...) -> str: ...
|
||||
def reset(self) -> None: ...
|
||||
def getstate(self) -> tuple[bytes, int]: ...
|
||||
def setstate(self, state: tuple[bytes, int]) -> None: ...
|
||||
@@ -190,8 +190,8 @@ class BufferedIncrementalDecoder(IncrementalDecoder):
|
||||
buffer: bytes
|
||||
def __init__(self, errors: str = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def _buffer_decode(self, input: bytes, errors: str, final: bool) -> tuple[str, int]: ...
|
||||
def decode(self, input: bytes, final: bool = ...) -> str: ...
|
||||
def _buffer_decode(self, input: ReadableBuffer, errors: str, final: bool) -> tuple[str, int]: ...
|
||||
def decode(self, input: ReadableBuffer, final: bool = ...) -> str: ...
|
||||
|
||||
# TODO: it is not possible to specify the requirement that all other
|
||||
# attributes and methods are passed-through from the stream.
|
||||
|
||||
Reference in New Issue
Block a user