Skip to content

Commit b08f0b2

Browse files
[ty] Sync vendored typeshed stubs (#21715)
Co-authored-by: typeshedbot <> Co-authored-by: David Peter <[email protected]>
1 parent d6e472f commit b08f0b2

File tree

22 files changed

+108
-49
lines changed

22 files changed

+108
-49
lines changed

crates/ty_ide/src/goto_type_definition.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,14 +145,14 @@ mod tests {
145145

146146
assert_snapshot!(test.goto_type_definition(), @r"
147147
info[goto-type-definition]: Type definition
148-
--> stdlib/typing.pyi:770:1
148+
--> stdlib/typing.pyi:781:1
149149
|
150-
768 | def __class_getitem__(cls, args: TypeVar | tuple[TypeVar, ...]) -> _Final: ...
151-
769 |
152-
770 | Generic: type[_Generic]
150+
779 | def __class_getitem__(cls, args: TypeVar | tuple[TypeVar, ...]) -> _Final: ...
151+
780 |
152+
781 | Generic: type[_Generic]
153153
| ^^^^^^^
154-
771 |
155-
772 | class _ProtocolMeta(ABCMeta):
154+
782 |
155+
783 | class _ProtocolMeta(ABCMeta):
156156
|
157157
info: Source
158158
--> main.py:4:1

crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr…_-_Syntax_(142fa2948c3c6cf1).snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,14 @@ error[missing-argument]: No argument provided for required parameter `arg` of bo
9191
7 | from typing_extensions import deprecated
9292
|
9393
info: Parameter declared here
94-
--> stdlib/typing_extensions.pyi:1000:28
94+
--> stdlib/typing_extensions.pyi:1001:28
9595
|
96-
998 | stacklevel: int
97-
999 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
98-
1000 | def __call__(self, arg: _T, /) -> _T: ...
96+
999 | stacklevel: int
97+
1000 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
98+
1001 | def __call__(self, arg: _T, /) -> _T: ...
9999
| ^^^^^^^
100-
1001 |
101-
1002 | @final
100+
1002 |
101+
1003 | @final
102102
|
103103
info: rule `missing-argument` is enabled by default
104104
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
f8cdc0bd526301e873cd952eb0d457bdf2554e57
1+
ef2b90c67e5c668b91b3ae121baf00ee5165c30b

crates/ty_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import sys
22
from _typeshed import Unused
3-
from collections.abc import Callable, Coroutine
3+
from collections.abc import Awaitable, Callable, Coroutine
44
from contextvars import Context
55
from typing import Any, TypeVar, final
66
from typing_extensions import Self
@@ -50,9 +50,12 @@ if sys.version_info >= (3, 11):
5050

5151
def get_loop(self) -> AbstractEventLoop:
5252
"""Return embedded event loop."""
53-
54-
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T:
55-
"""Run code in the embedded event loop."""
53+
if sys.version_info >= (3, 14):
54+
def run(self, coro: Awaitable[_T], *, context: Context | None = None) -> _T:
55+
"""Run code in the embedded event loop."""
56+
else:
57+
def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T:
58+
"""Run a coroutine inside the embedded event loop."""
5659

5760
if sys.version_info >= (3, 12):
5861
def run(

crates/ty_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class TransportSocket:
6969
def listen(self, backlog: int = ..., /) -> None: ...
7070
@deprecated("Removed in Python 3.11")
7171
def makefile(self) -> BinaryIO: ...
72-
@deprecated("Rmoved in Python 3.11")
72+
@deprecated("Removed in Python 3.11")
7373
def sendfile(self, file: BinaryIO, offset: int = 0, count: int | None = None) -> int: ...
7474
@deprecated("Removed in Python 3.11")
7575
def close(self) -> None: ...

crates/ty_vendored/vendor/typeshed/stdlib/calendar.pyi

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,12 @@ if sys.version_info >= (3, 12):
6464

6565
_LocaleType: TypeAlias = tuple[str | None, str | None]
6666

67-
class IllegalMonthError(ValueError):
67+
class IllegalMonthError(ValueError, IndexError):
68+
month: int
6869
def __init__(self, month: int) -> None: ...
6970

7071
class IllegalWeekdayError(ValueError):
72+
weekday: int
7173
def __init__(self, weekday: int) -> None: ...
7274

7375
def isleap(year: int) -> bool:

crates/ty_vendored/vendor/typeshed/stdlib/ipaddress.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]):
257257
258258
"""
259259

260-
def hosts(self) -> Iterator[_A] | list[_A]:
260+
def hosts(self) -> Iterator[_A]:
261261
"""Generate Iterator over usable hosts in a network.
262262
263263
This is like __iter__ except it doesn't return the network

crates/ty_vendored/vendor/typeshed/stdlib/mimetypes.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ read_mime_types(file) -- parse one file, return a dictionary or None
2525

2626
import sys
2727
from _typeshed import StrPath
28-
from collections.abc import Sequence
28+
from collections.abc import Iterable
2929
from typing import IO
3030

3131
__all__ = [
@@ -93,8 +93,8 @@ def guess_extension(type: str, strict: bool = True) -> str | None:
9393
but non-standard types.
9494
"""
9595

96-
def init(files: Sequence[str] | None = None) -> None: ...
97-
def read_mime_types(file: str) -> dict[str, str] | None: ...
96+
def init(files: Iterable[StrPath] | None = None) -> None: ...
97+
def read_mime_types(file: StrPath) -> dict[str, str] | None: ...
9898
def add_type(type: str, ext: str, strict: bool = True) -> None:
9999
"""Add a mapping between a type and an extension.
100100
@@ -116,7 +116,7 @@ if sys.version_info >= (3, 13):
116116
"""
117117

118118
inited: bool
119-
knownfiles: list[str]
119+
knownfiles: list[StrPath]
120120
suffix_map: dict[str, str]
121121
encodings_map: dict[str, str]
122122
types_map: dict[str, str]
@@ -134,7 +134,7 @@ class MimeTypes:
134134
encodings_map: dict[str, str]
135135
types_map: tuple[dict[str, str], dict[str, str]]
136136
types_map_inv: tuple[dict[str, str], dict[str, str]]
137-
def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ...
137+
def __init__(self, filenames: Iterable[StrPath] = (), strict: bool = True) -> None: ...
138138
def add_type(self, type: str, ext: str, strict: bool = True) -> None:
139139
"""Add a mapping between a type and an extension.
140140
@@ -196,7 +196,7 @@ class MimeTypes:
196196
but non-standard types.
197197
"""
198198

199-
def read(self, filename: str, strict: bool = True) -> None:
199+
def read(self, filename: StrPath, strict: bool = True) -> None:
200200
"""
201201
Read a single mime.types-format file, specified by pathname.
202202

crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]):
216216
def count(self, value: _T, /) -> int: ...
217217
def insert(self, index: SupportsIndex, object: _T, /) -> None: ...
218218
def remove(self, value: _T, /) -> None: ...
219+
if sys.version_info >= (3, 14):
220+
def copy(self) -> list[_T]: ...
219221
# Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison]
220222
# to work around invariance
221223
@overload
@@ -429,8 +431,9 @@ class SyncManager(BaseManager):
429431
def dict(self, iterable: Iterable[list[str]], /) -> DictProxy[str, str]: ...
430432
@overload
431433
def dict(self, iterable: Iterable[list[bytes]], /) -> DictProxy[bytes, bytes]: ...
434+
# Overloads are copied from builtins.list.__init__
432435
@overload
433-
def list(self, sequence: Sequence[_T], /) -> ListProxy[_T]: ...
436+
def list(self, iterable: Iterable[_T], /) -> ListProxy[_T]: ...
434437
@overload
435438
def list(self) -> ListProxy[Any]: ...
436439
if sys.version_info >= (3, 14):

crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from collections.abc import Callable, Iterable, Mapping
23
from typing import Any
34

@@ -33,6 +34,11 @@ class BaseProcess:
3334
"""
3435
Start child process
3536
"""
37+
if sys.version_info >= (3, 14):
38+
def interrupt(self) -> None:
39+
"""
40+
Terminate process; sends SIGINT signal
41+
"""
3642

3743
def terminate(self) -> None:
3844
"""

0 commit comments

Comments
 (0)