Skip to content

Commit cdad278

Browse files
author
mypybot
committed
Sync typeshed
Source commit: python/typeshed@a3ce512
1 parent 8b82547 commit cdad278

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+497
-314
lines changed

mypy/typeshed/stdlib/_codecs.pyi

+34-27
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import codecs
22
import sys
3+
from _typeshed import ReadableBuffer
34
from collections.abc import Callable
45
from typing import overload
56
from typing_extensions import Literal, TypeAlias
@@ -44,13 +45,13 @@ _BytesToBytesEncoding: TypeAlias = Literal[
4445
_StrToStrEncoding: TypeAlias = Literal["rot13", "rot_13"]
4546

4647
@overload
47-
def encode(obj: bytes, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ...
48+
def encode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ...
4849
@overload
4950
def encode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ... # type: ignore[misc]
5051
@overload
5152
def encode(obj: str, encoding: str = ..., errors: str = ...) -> bytes: ...
5253
@overload
53-
def decode(obj: bytes, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... # type: ignore[misc]
54+
def decode(obj: ReadableBuffer, encoding: _BytesToBytesEncoding, errors: str = ...) -> bytes: ... # type: ignore[misc]
5455
@overload
5556
def decode(obj: str, encoding: _StrToStrEncoding, errors: str = ...) -> str: ...
5657

@@ -64,66 +65,72 @@ def decode(
6465
@overload
6566
def decode(obj: str, encoding: Literal["hex", "hex_codec"], errors: str = ...) -> bytes: ...
6667
@overload
67-
def decode(obj: bytes, encoding: str = ..., errors: str = ...) -> str: ...
68+
def decode(obj: ReadableBuffer, encoding: str = ..., errors: str = ...) -> str: ...
6869
def lookup(__encoding: str) -> codecs.CodecInfo: ...
6970
def charmap_build(__map: str) -> _CharMap: ...
70-
def ascii_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
71+
def ascii_decode(__data: ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
7172
def ascii_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
72-
def charmap_decode(__data: bytes, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[str, int]: ...
73+
def charmap_decode(__data: ReadableBuffer, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[str, int]: ...
7374
def charmap_encode(__str: str, __errors: str | None = ..., __mapping: _CharMap | None = ...) -> tuple[bytes, int]: ...
74-
def escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
75+
def escape_decode(__data: str | ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
7576
def escape_encode(__data: bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
76-
def latin_1_decode(__data: bytes, __errors: str | None = ...) -> tuple[str, int]: ...
77+
def latin_1_decode(__data: ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
7778
def latin_1_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
7879

7980
if sys.version_info >= (3, 9):
80-
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
81+
def raw_unicode_escape_decode(
82+
__data: str | ReadableBuffer, __errors: str | None = ..., __final: bool = ...
83+
) -> tuple[str, int]: ...
8184

8285
else:
83-
def raw_unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
86+
def raw_unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
8487

8588
def raw_unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
86-
def readbuffer_encode(__data: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
89+
def readbuffer_encode(__data: str | ReadableBuffer, __errors: str | None = ...) -> tuple[bytes, int]: ...
8790

8891
if sys.version_info >= (3, 9):
89-
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ..., __final: bool = ...) -> tuple[str, int]: ...
92+
def unicode_escape_decode(
93+
__data: str | ReadableBuffer, __errors: str | None = ..., __final: bool = ...
94+
) -> tuple[str, int]: ...
9095

9196
else:
92-
def unicode_escape_decode(__data: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
97+
def unicode_escape_decode(__data: str | ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
9398

9499
def unicode_escape_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
95100

96101
if sys.version_info < (3, 8):
97-
def unicode_internal_decode(__obj: str | bytes, __errors: str | None = ...) -> tuple[str, int]: ...
98-
def unicode_internal_encode(__obj: str | bytes, __errors: str | None = ...) -> tuple[bytes, int]: ...
102+
def unicode_internal_decode(__obj: str | ReadableBuffer, __errors: str | None = ...) -> tuple[str, int]: ...
103+
def unicode_internal_encode(__obj: str | ReadableBuffer, __errors: str | None = ...) -> tuple[bytes, int]: ...
99104

100-
def utf_16_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
105+
def utf_16_be_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
101106
def utf_16_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
102-
def utf_16_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
107+
def utf_16_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
103108
def utf_16_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
104109
def utf_16_ex_decode(
105-
__data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
110+
__data: ReadableBuffer, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
106111
) -> tuple[str, int, int]: ...
107-
def utf_16_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
112+
def utf_16_le_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
108113
def utf_16_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
109-
def utf_32_be_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
114+
def utf_32_be_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
110115
def utf_32_be_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
111-
def utf_32_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
116+
def utf_32_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
112117
def utf_32_encode(__str: str, __errors: str | None = ..., __byteorder: int = ...) -> tuple[bytes, int]: ...
113118
def utf_32_ex_decode(
114-
__data: bytes, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
119+
__data: ReadableBuffer, __errors: str | None = ..., __byteorder: int = ..., __final: int = ...
115120
) -> tuple[str, int, int]: ...
116-
def utf_32_le_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
121+
def utf_32_le_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
117122
def utf_32_le_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
118-
def utf_7_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
123+
def utf_7_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
119124
def utf_7_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
120-
def utf_8_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
125+
def utf_8_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
121126
def utf_8_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
122127

123128
if sys.platform == "win32":
124-
def mbcs_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
129+
def mbcs_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
125130
def mbcs_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
126-
def code_page_decode(__codepage: int, __data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
131+
def code_page_decode(
132+
__codepage: int, __data: ReadableBuffer, __errors: str | None = ..., __final: int = ...
133+
) -> tuple[str, int]: ...
127134
def code_page_encode(__code_page: int, __str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...
128-
def oem_decode(__data: bytes, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
135+
def oem_decode(__data: ReadableBuffer, __errors: str | None = ..., __final: int = ...) -> tuple[str, int]: ...
129136
def oem_encode(__str: str, __errors: str | None = ...) -> tuple[bytes, int]: ...

mypy/typeshed/stdlib/_curses.pyi

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import sys
2-
from _typeshed import SupportsRead
2+
from _typeshed import ReadOnlyBuffer, SupportsRead
33
from typing import IO, Any, NamedTuple, overload
44
from typing_extensions import TypeAlias, final
55

66
if sys.platform != "win32":
7+
# Handled by PyCurses_ConvertToChtype in _cursesmodule.c.
78
_ChType: TypeAlias = str | bytes | int
89

910
# ACS codes are only initialized after initscr is called
@@ -330,7 +331,7 @@ if sys.platform != "win32":
330331
def noraw() -> None: ...
331332
def pair_content(__pair_number: int) -> tuple[int, int]: ...
332333
def pair_number(__attr: int) -> int: ...
333-
def putp(__string: bytes) -> None: ...
334+
def putp(__string: ReadOnlyBuffer) -> None: ...
334335
def qiflush(__flag: bool = ...) -> None: ...
335336
def raw(__flag: bool = ...) -> None: ...
336337
def reset_prog_mode() -> None: ...
@@ -352,7 +353,7 @@ if sys.platform != "win32":
352353
def tigetnum(__capname: str) -> int: ...
353354
def tigetstr(__capname: str) -> bytes | None: ...
354355
def tparm(
355-
__str: bytes,
356+
__str: ReadOnlyBuffer,
356357
__i1: int = ...,
357358
__i2: int = ...,
358359
__i3: int = ...,

mypy/typeshed/stdlib/_msi.pyi

+5-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ if sys.platform == "win32":
1212
# Don't exist at runtime
1313
__new__: None # type: ignore[assignment]
1414
__init__: None # type: ignore[assignment]
15-
# Actual typename Summary, not exposed by the implementation
16-
class _Summary:
17-
def GetProperty(self, propid: int) -> str | bytes | None: ...
15+
# Actual typename SummaryInformation, not exposed by the implementation
16+
class _SummaryInformation:
17+
def GetProperty(self, field: int) -> int | bytes | None: ...
1818
def GetPropertyCount(self) -> int: ...
19-
def SetProperty(self, propid: int, value: str | bytes) -> None: ...
19+
def SetProperty(self, field: int, value: int | str) -> None: ...
2020
def Persist(self) -> None: ...
2121
# Don't exist at runtime
2222
__new__: None # type: ignore[assignment]
@@ -25,7 +25,7 @@ if sys.platform == "win32":
2525
class _Database:
2626
def OpenView(self, sql: str) -> _View: ...
2727
def Commit(self) -> None: ...
28-
def GetSummaryInformation(self, updateCount: int) -> _Summary: ...
28+
def GetSummaryInformation(self, updateCount: int) -> _SummaryInformation: ...
2929
def Close(self) -> None: ...
3030
# Don't exist at runtime
3131
__new__: None # type: ignore[assignment]
+25-17
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,32 @@
11
import sys
2+
from _typeshed import StrOrBytesPath
23
from collections.abc import Callable, Sequence
4+
from typing_extensions import SupportsIndex
35

46
if sys.platform != "win32":
57
def cloexec_pipe() -> tuple[int, int]: ...
68
def fork_exec(
7-
args: Sequence[str],
8-
executable_list: Sequence[bytes],
9-
close_fds: bool,
10-
fds_to_keep: Sequence[int],
11-
cwd: str,
12-
env_list: Sequence[bytes],
13-
p2cread: int,
14-
p2cwrite: int,
15-
c2pred: int,
16-
c2pwrite: int,
17-
errread: int,
18-
errwrite: int,
19-
errpipe_read: int,
20-
errpipe_write: int,
21-
restore_signals: int,
22-
start_new_session: int,
23-
preexec_fn: Callable[[], None],
9+
__process_args: Sequence[StrOrBytesPath] | None,
10+
__executable_list: Sequence[bytes],
11+
__close_fds: bool,
12+
__fds_to_keep: tuple[int, ...],
13+
__cwd_obj: str,
14+
__env_list: Sequence[bytes] | None,
15+
__p2cread: int,
16+
__p2cwrite: int,
17+
__c2pred: int,
18+
__c2pwrite: int,
19+
__errread: int,
20+
__errwrite: int,
21+
__errpipe_read: int,
22+
__errpipe_write: int,
23+
__restore_signals: int,
24+
__call_setsid: int,
25+
__pgid_to_set: int,
26+
__gid_object: SupportsIndex | None,
27+
__groups_list: list[int] | None,
28+
__uid_object: SupportsIndex | None,
29+
__child_umask: int,
30+
__preexec_fn: Callable[[], None],
31+
__allow_vfork: bool,
2432
) -> int: ...

mypy/typeshed/stdlib/_socket.pyi

+9-9
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ _CMSG: TypeAlias = tuple[int, int, bytes]
1515
_CMSGArg: TypeAlias = tuple[int, int, ReadableBuffer]
1616

1717
# Addresses can be either tuples of varying lengths (AF_INET, AF_INET6,
18-
# AF_NETLINK, AF_TIPC) or strings (AF_UNIX).
19-
_Address: TypeAlias = tuple[Any, ...] | str
18+
# AF_NETLINK, AF_TIPC) or strings/buffers (AF_UNIX).
19+
# See getsockaddrarg() in socketmodule.c.
20+
_Address: TypeAlias = tuple[Any, ...] | str | ReadableBuffer
2021
_RetAddress: TypeAlias = Any
21-
# TODO Most methods allow bytes as address objects
2222

2323
# ----- Constants -----
2424
# Some socket families are listed in the "Socket families" section of the docs,
@@ -584,10 +584,10 @@ class socket:
584584
@property
585585
def timeout(self) -> float | None: ...
586586
def __init__(self, family: int = ..., type: int = ..., proto: int = ..., fileno: _FD | None = ...) -> None: ...
587-
def bind(self, __address: _Address | bytes) -> None: ...
587+
def bind(self, __address: _Address) -> None: ...
588588
def close(self) -> None: ...
589-
def connect(self, __address: _Address | bytes) -> None: ...
590-
def connect_ex(self, __address: _Address | bytes) -> int: ...
589+
def connect(self, __address: _Address) -> None: ...
590+
def connect_ex(self, __address: _Address) -> int: ...
591591
def detach(self) -> int: ...
592592
def fileno(self) -> int: ...
593593
def getpeername(self) -> _RetAddress: ...
@@ -634,7 +634,7 @@ class socket:
634634
def setblocking(self, __flag: bool) -> None: ...
635635
def settimeout(self, __value: float | None) -> None: ...
636636
@overload
637-
def setsockopt(self, __level: int, __optname: int, __value: int | bytes) -> None: ...
637+
def setsockopt(self, __level: int, __optname: int, __value: int | ReadableBuffer) -> None: ...
638638
@overload
639639
def setsockopt(self, __level: int, __optname: int, __value: None, __optlen: int) -> None: ...
640640
if sys.platform == "win32":
@@ -671,9 +671,9 @@ def ntohs(__x: int) -> int: ... # param & ret val are 16-bit ints
671671
def htonl(__x: int) -> int: ... # param & ret val are 32-bit ints
672672
def htons(__x: int) -> int: ... # param & ret val are 16-bit ints
673673
def inet_aton(__ip_string: str) -> bytes: ... # ret val 4 bytes in length
674-
def inet_ntoa(__packed_ip: bytes) -> str: ...
674+
def inet_ntoa(__packed_ip: ReadableBuffer) -> str: ...
675675
def inet_pton(__address_family: int, __ip_string: str) -> bytes: ...
676-
def inet_ntop(__address_family: int, __packed_ip: bytes) -> str: ...
676+
def inet_ntop(__address_family: int, __packed_ip: ReadableBuffer) -> str: ...
677677
def getdefaulttimeout() -> float | None: ...
678678
def setdefaulttimeout(__timeout: float | None) -> None: ...
679679

mypy/typeshed/stdlib/_tkinter.pyi

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ from typing_extensions import Literal, final
1717
# (<textindex object: '1.0'>, <textindex object: '2.0'>)
1818
@final
1919
class Tcl_Obj:
20-
string: str | bytes
21-
typename: str
20+
@property
21+
def string(self) -> str: ...
22+
@property
23+
def typename(self) -> str: ...
2224
__hash__: ClassVar[None] # type: ignore[assignment]
2325
def __eq__(self, __other): ...
2426
def __ge__(self, __other): ...

mypy/typeshed/stdlib/_typeshed/__init__.pyi

+1
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ else:
234234
WriteableBuffer: TypeAlias = bytearray | memoryview | array.array[Any] | mmap.mmap | ctypes._CData # stable
235235
# Same as _WriteableBuffer, but also includes read-only buffer types (like bytes).
236236
ReadableBuffer: TypeAlias = ReadOnlyBuffer | WriteableBuffer # stable
237+
_BufferWithLen: TypeAlias = ReadableBuffer # not stable # noqa: Y047
237238

238239
ExcInfo: TypeAlias = tuple[type[BaseException], BaseException, TracebackType]
239240
OptExcInfo: TypeAlias = Union[ExcInfo, tuple[None, None, None]]

mypy/typeshed/stdlib/_winapi.pyi

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import sys
2+
from _typeshed import ReadableBuffer
23
from collections.abc import Sequence
34
from typing import Any, NoReturn, overload
45
from typing_extensions import Literal, final
@@ -198,11 +199,11 @@ if sys.platform == "win32":
198199
def WaitForSingleObject(__handle: int, __milliseconds: int) -> int: ...
199200
def WaitNamedPipe(__name: str, __timeout: int) -> None: ...
200201
@overload
201-
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
202+
def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
202203
@overload
203-
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> tuple[int, int]: ...
204+
def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = ...) -> tuple[int, int]: ...
204205
@overload
205-
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> tuple[Any, int]: ...
206+
def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ...
206207
@final
207208
class Overlapped:
208209
event: int

mypy/typeshed/stdlib/abc.pyi

+1-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ class ABCMeta(type):
1616
__mcls: type[Self], __name: str, __bases: tuple[type, ...], __namespace: dict[str, Any], **kwargs: Any
1717
) -> Self: ...
1818
else:
19-
# pyright doesn't like the first parameter being called mcls, hence the `pyright: ignore`
20-
def __new__(
21-
mcls: type[Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any # pyright: ignore
22-
) -> Self: ...
19+
def __new__(mcls: type[Self], name: str, bases: tuple[type, ...], namespace: dict[str, Any], **kwargs: Any) -> Self: ...
2320

2421
def __instancecheck__(cls: ABCMeta, instance: Any) -> Any: ...
2522
def __subclasscheck__(cls: ABCMeta, subclass: Any) -> Any: ...

mypy/typeshed/stdlib/antigravity.pyi

+3-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
def geohash(latitude: float, longitude: float, datedow: bytes) -> None: ...
1+
from _typeshed import ReadableBuffer
2+
3+
def geohash(latitude: float, longitude: float, datedow: ReadableBuffer) -> None: ...

mypy/typeshed/stdlib/array.pyi

+9-5
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,19 @@ class array(MutableSequence[_T], Generic[_T]):
2121
@property
2222
def itemsize(self) -> int: ...
2323
@overload
24-
def __init__(self: array[int], __typecode: _IntTypeCode, __initializer: bytes | Iterable[int] = ...) -> None: ...
24+
def __init__(self: array[int], __typecode: _IntTypeCode, __initializer: bytes | bytearray | Iterable[int] = ...) -> None: ...
2525
@overload
26-
def __init__(self: array[float], __typecode: _FloatTypeCode, __initializer: bytes | Iterable[float] = ...) -> None: ...
26+
def __init__(
27+
self: array[float], __typecode: _FloatTypeCode, __initializer: bytes | bytearray | Iterable[float] = ...
28+
) -> None: ...
2729
@overload
28-
def __init__(self: array[str], __typecode: _UnicodeTypeCode, __initializer: bytes | Iterable[str] = ...) -> None: ...
30+
def __init__(
31+
self: array[str], __typecode: _UnicodeTypeCode, __initializer: bytes | bytearray | Iterable[str] = ...
32+
) -> None: ...
2933
@overload
3034
def __init__(self, __typecode: str, __initializer: Iterable[_T]) -> None: ...
3135
@overload
32-
def __init__(self, __typecode: str, __initializer: bytes = ...) -> None: ...
36+
def __init__(self, __typecode: str, __initializer: bytes | bytearray = ...) -> None: ...
3337
def append(self, __v: _T) -> None: ...
3438
def buffer_info(self) -> tuple[int, int]: ...
3539
def byteswap(self) -> None: ...
@@ -52,7 +56,7 @@ class array(MutableSequence[_T], Generic[_T]):
5256
def tolist(self) -> list[_T]: ...
5357
def tounicode(self) -> str: ...
5458
if sys.version_info < (3, 9):
55-
def fromstring(self, __buffer: bytes) -> None: ...
59+
def fromstring(self, __buffer: str | ReadableBuffer) -> None: ...
5660
def tostring(self) -> bytes: ...
5761

5862
def __len__(self) -> int: ...

0 commit comments

Comments
 (0)