Skip to content

Commit 3785e13

Browse files
[ty] Sync vendored typeshed stubs (astral-sh#19461)
Co-authored-by: typeshedbot <> Co-authored-by: Alex Waygood <[email protected]>
1 parent c2380fa commit 3785e13

File tree

597 files changed

+1407
-2120
lines changed

Some content is hidden

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

597 files changed

+1407
-2120
lines changed

crates/ty_ide/src/completion.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1618,6 +1618,8 @@ Answer.<CURSOR>
16181618
__text_signature__ :: str | None
16191619
__type_params__ :: tuple[TypeVar | ParamSpec | TypeVarTuple, ...]
16201620
__weakrefoffset__ :: int
1621+
_add_alias_ :: def _add_alias_(self, name: str) -> None
1622+
_add_value_alias_ :: def _add_value_alias_(self, value: Any) -> None
16211623
_generate_next_value_ :: def _generate_next_value_(name: str, start: int, count: int, last_values: list[Any]) -> Any
16221624
_ignore_ :: str | list[str]
16231625
_member_map_ :: dict[str, Enum]

crates/ty_ide/src/goto_type_definition.rs

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,14 @@ mod tests {
198198

199199
assert_snapshot!(test.goto_type_definition(), @r#"
200200
info[goto-type-definition]: Type definition
201-
--> stdlib/builtins.pyi:892:7
201+
--> stdlib/builtins.pyi:890:7
202202
|
203-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
204-
891 |
205-
892 | class str(Sequence[str]):
203+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
204+
889 |
205+
890 | class str(Sequence[str]):
206206
| ^^^
207-
893 | """str(object='') -> str
208-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
207+
891 | """str(object='') -> str
208+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
209209
|
210210
info: Source
211211
--> main.py:4:13
@@ -227,14 +227,14 @@ mod tests {
227227

228228
assert_snapshot!(test.goto_type_definition(), @r#"
229229
info[goto-type-definition]: Type definition
230-
--> stdlib/builtins.pyi:892:7
230+
--> stdlib/builtins.pyi:890:7
231231
|
232-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
233-
891 |
234-
892 | class str(Sequence[str]):
232+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
233+
889 |
234+
890 | class str(Sequence[str]):
235235
| ^^^
236-
893 | """str(object='') -> str
237-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
236+
891 | """str(object='') -> str
237+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
238238
|
239239
info: Source
240240
--> main.py:2:22
@@ -343,14 +343,14 @@ mod tests {
343343

344344
assert_snapshot!(test.goto_type_definition(), @r#"
345345
info[goto-type-definition]: Type definition
346-
--> stdlib/builtins.pyi:892:7
346+
--> stdlib/builtins.pyi:890:7
347347
|
348-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
349-
891 |
350-
892 | class str(Sequence[str]):
348+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
349+
889 |
350+
890 | class str(Sequence[str]):
351351
| ^^^
352-
893 | """str(object='') -> str
353-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
352+
891 | """str(object='') -> str
353+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
354354
|
355355
info: Source
356356
--> main.py:4:18
@@ -378,14 +378,14 @@ mod tests {
378378
// is an int. Navigating to `str` would match pyright's behavior.
379379
assert_snapshot!(test.goto_type_definition(), @r#"
380380
info[goto-type-definition]: Type definition
381-
--> stdlib/builtins.pyi:338:7
381+
--> stdlib/builtins.pyi:337:7
382382
|
383-
336 | _LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
384-
337 |
385-
338 | class int:
383+
335 | _LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
384+
336 |
385+
337 | class int:
386386
| ^^^
387-
339 | """int([x]) -> integer
388-
340 | int(x, base=10) -> integer
387+
338 | """int([x]) -> integer
388+
339 | int(x, base=10) -> integer
389389
|
390390
info: Source
391391
--> main.py:4:18
@@ -412,14 +412,14 @@ f(**kwargs<CURSOR>)
412412

413413
assert_snapshot!(test.goto_type_definition(), @r#"
414414
info[goto-type-definition]: Type definition
415-
--> stdlib/builtins.pyi:2892:7
415+
--> stdlib/builtins.pyi:2888:7
416416
|
417-
2890 | """See PEP 585"""
418-
2891 |
419-
2892 | class dict(MutableMapping[_KT, _VT]):
417+
2886 | """See PEP 585"""
418+
2887 |
419+
2888 | class dict(MutableMapping[_KT, _VT]):
420420
| ^^^^
421-
2893 | """dict() -> new empty dictionary
422-
2894 | dict(mapping) -> new dictionary initialized from a mapping object's
421+
2889 | """dict() -> new empty dictionary
422+
2890 | dict(mapping) -> new dictionary initialized from a mapping object's
423423
|
424424
info: Source
425425
--> main.py:6:5
@@ -443,14 +443,14 @@ f(**kwargs<CURSOR>)
443443

444444
assert_snapshot!(test.goto_type_definition(), @r#"
445445
info[goto-type-definition]: Type definition
446-
--> stdlib/builtins.pyi:892:7
446+
--> stdlib/builtins.pyi:890:7
447447
|
448-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
449-
891 |
450-
892 | class str(Sequence[str]):
448+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
449+
889 |
450+
890 | class str(Sequence[str]):
451451
| ^^^
452-
893 | """str(object='') -> str
453-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
452+
891 | """str(object='') -> str
453+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
454454
|
455455
info: Source
456456
--> main.py:3:17
@@ -536,14 +536,14 @@ f(**kwargs<CURSOR>)
536536

537537
assert_snapshot!(test.goto_type_definition(), @r#"
538538
info[goto-type-definition]: Type definition
539-
--> stdlib/builtins.pyi:892:7
539+
--> stdlib/builtins.pyi:890:7
540540
|
541-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
542-
891 |
543-
892 | class str(Sequence[str]):
541+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
542+
889 |
543+
890 | class str(Sequence[str]):
544544
| ^^^
545-
893 | """str(object='') -> str
546-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
545+
891 | """str(object='') -> str
546+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
547547
|
548548
info: Source
549549
--> main.py:4:27
@@ -567,13 +567,13 @@ f(**kwargs<CURSOR>)
567567

568568
assert_snapshot!(test.goto_type_definition(), @r#"
569569
info[goto-type-definition]: Type definition
570-
--> stdlib/types.pyi:922:11
570+
--> stdlib/types.pyi:921:11
571571
|
572-
920 | if sys.version_info >= (3, 10):
573-
921 | @final
574-
922 | class NoneType:
572+
919 | if sys.version_info >= (3, 10):
573+
920 | @final
574+
921 | class NoneType:
575575
| ^^^^^^^^
576-
923 | """The type of the None singleton."""
576+
922 | """The type of the None singleton."""
577577
|
578578
info: Source
579579
--> main.py:3:17
@@ -584,14 +584,14 @@ f(**kwargs<CURSOR>)
584584
|
585585
586586
info[goto-type-definition]: Type definition
587-
--> stdlib/builtins.pyi:892:7
587+
--> stdlib/builtins.pyi:890:7
588588
|
589-
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
590-
891 |
591-
892 | class str(Sequence[str]):
589+
888 | def __getitem__(self, key: int, /) -> str | int | None: ...
590+
889 |
591+
890 | class str(Sequence[str]):
592592
| ^^^
593-
893 | """str(object='') -> str
594-
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
593+
891 | """str(object='') -> str
594+
892 | str(bytes_or_buffer[, encoding[, errors]]) -> str
595595
|
596596
info: Source
597597
--> main.py:3:17

crates/ty_python_semantic/resources/mdtest/snapshots/invalid_argument_typ…_-_Invalid_argument_typ…_-_Test_calling_a_funct…_(3b18271a821a59b).snap

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ error[invalid-argument-type]: Argument to function `loads` is incorrect
2929
| ^ Expected `str | bytes | bytearray`, found `Literal[5]`
3030
|
3131
info: Function defined here
32-
--> stdlib/json/__init__.pyi:219:5
32+
--> stdlib/json/__init__.pyi:218:5
3333
|
34-
217 | """
35-
218 |
36-
219 | def loads(
34+
216 | """
35+
217 |
36+
218 | def loads(
3737
| ^^^^^
38-
220 | s: str | bytes | bytearray,
38+
219 | s: str | bytes | bytearray,
3939
| -------------------------- Parameter declared here
40-
221 | *,
41-
222 | cls: type[JSONDecoder] | None = None,
40+
220 | *,
41+
221 | cls: type[JSONDecoder] | None = None,
4242
|
4343
info: rule `invalid-argument-type` is enabled by default
4444

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
84e41f2853d7af3d651d620f093031cba849bd1d
1+
08225953c98cfd375d80bc88865e5aae77d2c07f

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Record of phased-in incompatible language changes.
1+
"""Record of phased-in incompatible language changes.
32
43
Each line is of the form:
54

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
Accelerator module for asyncio
3-
"""
1+
"""Accelerator module for asyncio"""
42

53
import sys
64
from asyncio.events import AbstractEventLoop

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Bisection algorithms.
1+
"""Bisection algorithms.
32
43
This module provides support for maintaining a list in sorted order without
54
having to sort the list after each insertion. For long lists of items with

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
"""
2-
_blake2b provides BLAKE2b for hashlib
3-
"""
1+
"""_blake2b provides BLAKE2b for hashlib"""
42

53
from _typeshed import ReadableBuffer
64
from typing import ClassVar, final
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1+
"""A minimal subset of the locale module used at interpreter startup
2+
(imported by the _io module), in order to reduce startup time.
3+
4+
Don't import directly from third-party code; use the `locale` module instead!
5+
"""
6+
17
def getpreferredencoding(do_setlocale: bool = True) -> str: ...

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
"""
2-
Abstract Base Classes (ABCs) for collections, according to PEP 3119.
1+
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
32
43
Unit tests are in test_collections.
54
"""

0 commit comments

Comments
 (0)