mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
bytes, bytearray constructors: support buffers (#8924)
This commit is contained in:
@@ -587,15 +587,11 @@ class str(Sequence[str]):
|
||||
|
||||
class bytes(ByteString):
|
||||
@overload
|
||||
def __new__(cls: type[Self], __ints: Iterable[SupportsIndex]) -> Self: ...
|
||||
def __new__(cls: type[Self], __o: Iterable[SupportsIndex] | SupportsIndex | SupportsBytes | ReadableBuffer) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls: type[Self], __string: str, encoding: str, errors: str = ...) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls: type[Self], __length: SupportsIndex) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls: type[Self]) -> Self: ...
|
||||
@overload
|
||||
def __new__(cls: type[Self], __o: SupportsBytes) -> Self: ...
|
||||
def capitalize(self) -> bytes: ...
|
||||
def center(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytes: ...
|
||||
def count(
|
||||
@@ -696,11 +692,9 @@ class bytearray(MutableSequence[int], ByteString):
|
||||
@overload
|
||||
def __init__(self) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __ints: Iterable[SupportsIndex]) -> None: ...
|
||||
def __init__(self, __ints: Iterable[SupportsIndex] | SupportsIndex | ReadableBuffer) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __string: str, encoding: str, errors: str = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, __length: SupportsIndex) -> None: ...
|
||||
def append(self, __item: SupportsIndex) -> None: ...
|
||||
def capitalize(self) -> bytearray: ...
|
||||
def center(self, __width: SupportsIndex, __fillchar: bytes = ...) -> bytearray: ...
|
||||
|
||||
Reference in New Issue
Block a user