Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class array(MutableSequence[_T], Generic[_T]):
def tolist(self) -> list[_T]: ...
def tounicode(self) -> str: ...
if sys.version_info < (3, 9):
def fromstring(self, __buffer: bytes) -> None: ...
def fromstring(self, __buffer: str | ReadableBuffer) -> None: ...
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

proof (on 3.6):

>>> array.array("b", []).fromstring("x") >>> array.array("b", []).fromstring(42) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: a bytes-like object is required, not 'int' >>> array.array("b", []).fromstring(b"x") >>> 
def tostring(self) -> bytes: ...

def __len__(self) -> int: ...
Expand Down