Skip to content

Commit a0d4e1f

Browse files
[ty] Sync vendored typeshed stubs (#19368)
Co-authored-by: typeshedbot <> Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
1 parent c0d04f2 commit a0d4e1f

File tree

469 files changed

+10781
-23229
lines changed

Some content is hidden

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

469 files changed

+10781
-23229
lines changed

crates/ty_ide/src/goto.rs

Lines changed: 74 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -423,15 +423,15 @@ mod tests {
423423

424424
assert_snapshot!(test.goto_type_definition(), @r#"
425425
info[goto-type-definition]: Type definition
426-
--> stdlib/builtins.pyi:1120:7
427-
|
428-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
429-
1119 |
430-
1120 | class str(Sequence[str]):
431-
| ^^^
432-
1121 | """
433-
1122 | str(object='') -> str
434-
|
426+
--> stdlib/builtins.pyi:892:7
427+
|
428+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
429+
891 |
430+
892 | class str(Sequence[str]):
431+
| ^^^
432+
893 | """str(object='') -> str
433+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
434+
|
435435
info: Source
436436
--> main.py:4:13
437437
|
@@ -452,15 +452,15 @@ mod tests {
452452

453453
assert_snapshot!(test.goto_type_definition(), @r#"
454454
info[goto-type-definition]: Type definition
455-
--> stdlib/builtins.pyi:1120:7
456-
|
457-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
458-
1119 |
459-
1120 | class str(Sequence[str]):
460-
| ^^^
461-
1121 | """
462-
1122 | str(object='') -> str
463-
|
455+
--> stdlib/builtins.pyi:892:7
456+
|
457+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
458+
891 |
459+
892 | class str(Sequence[str]):
460+
| ^^^
461+
893 | """str(object='') -> str
462+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
463+
|
464464
info: Source
465465
--> main.py:2:22
466466
|
@@ -568,15 +568,15 @@ mod tests {
568568

569569
assert_snapshot!(test.goto_type_definition(), @r#"
570570
info[goto-type-definition]: Type definition
571-
--> stdlib/builtins.pyi:1120:7
572-
|
573-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
574-
1119 |
575-
1120 | class str(Sequence[str]):
576-
| ^^^
577-
1121 | """
578-
1122 | str(object='') -> str
579-
|
571+
--> stdlib/builtins.pyi:892:7
572+
|
573+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
574+
891 |
575+
892 | class str(Sequence[str]):
576+
| ^^^
577+
893 | """str(object='') -> str
578+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
579+
|
580580
info: Source
581581
--> main.py:4:18
582582
|
@@ -603,14 +603,14 @@ mod tests {
603603
// is an int. Navigating to `str` would match pyright's behavior.
604604
assert_snapshot!(test.goto_type_definition(), @r#"
605605
info[goto-type-definition]: Type definition
606-
--> stdlib/builtins.pyi:365:7
606+
--> stdlib/builtins.pyi:338:7
607607
|
608-
363 | _LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
609-
364 |
610-
365 | class int:
608+
336 | _LiteralInteger = _PositiveInteger | _NegativeInteger | Literal[0] # noqa: Y026 # TODO: Use TypeAlias once mypy bugs are fixed
609+
337 |
610+
338 | class int:
611611
| ^^^
612-
366 | """
613-
367 | int([x]) -> integer
612+
339 | """int([x]) -> integer
613+
340 | int(x, base=10) -> integer
614614
|
615615
info: Source
616616
--> main.py:4:18
@@ -637,14 +637,14 @@ f(**kwargs<CURSOR>)
637637

638638
assert_snapshot!(test.goto_type_definition(), @r#"
639639
info[goto-type-definition]: Type definition
640-
--> stdlib/builtins.pyi:3458:7
640+
--> stdlib/builtins.pyi:2892:7
641641
|
642-
3456 | """
643-
3457 |
644-
3458 | class dict(MutableMapping[_KT, _VT]):
642+
2890 | """See PEP 585"""
643+
2891 |
644+
2892 | class dict(MutableMapping[_KT, _VT]):
645645
| ^^^^
646-
3459 | """
647-
3460 | dict() -> new empty dictionary
646+
2893 | """dict() -> new empty dictionary
647+
2894 | dict(mapping) -> new dictionary initialized from a mapping object's
648648
|
649649
info: Source
650650
--> main.py:6:5
@@ -668,15 +668,15 @@ f(**kwargs<CURSOR>)
668668

669669
assert_snapshot!(test.goto_type_definition(), @r#"
670670
info[goto-type-definition]: Type definition
671-
--> stdlib/builtins.pyi:1120:7
672-
|
673-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
674-
1119 |
675-
1120 | class str(Sequence[str]):
676-
| ^^^
677-
1121 | """
678-
1122 | str(object='') -> str
679-
|
671+
--> stdlib/builtins.pyi:892:7
672+
|
673+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
674+
891 |
675+
892 | class str(Sequence[str]):
676+
| ^^^
677+
893 | """str(object='') -> str
678+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
679+
|
680680
info: Source
681681
--> main.py:3:17
682682
|
@@ -761,15 +761,15 @@ f(**kwargs<CURSOR>)
761761

762762
assert_snapshot!(test.goto_type_definition(), @r#"
763763
info[goto-type-definition]: Type definition
764-
--> stdlib/builtins.pyi:1120:7
765-
|
766-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
767-
1119 |
768-
1120 | class str(Sequence[str]):
769-
| ^^^
770-
1121 | """
771-
1122 | str(object='') -> str
772-
|
764+
--> stdlib/builtins.pyi:892:7
765+
|
766+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
767+
891 |
768+
892 | class str(Sequence[str]):
769+
| ^^^
770+
893 | """str(object='') -> str
771+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
772+
|
773773
info: Source
774774
--> main.py:4:27
775775
|
@@ -792,15 +792,14 @@ f(**kwargs<CURSOR>)
792792

793793
assert_snapshot!(test.goto_type_definition(), @r#"
794794
info[goto-type-definition]: Type definition
795-
--> stdlib/types.pyi:1073:11
796-
|
797-
1071 | if sys.version_info >= (3, 10):
798-
1072 | @final
799-
1073 | class NoneType:
800-
| ^^^^^^^^
801-
1074 | """
802-
1075 | The type of the None singleton.
803-
|
795+
--> stdlib/types.pyi:922:11
796+
|
797+
920 | if sys.version_info >= (3, 10):
798+
921 | @final
799+
922 | class NoneType:
800+
| ^^^^^^^^
801+
923 | """The type of the None singleton."""
802+
|
804803
info: Source
805804
--> main.py:3:17
806805
|
@@ -810,15 +809,15 @@ f(**kwargs<CURSOR>)
810809
|
811810
812811
info[goto-type-definition]: Type definition
813-
--> stdlib/builtins.pyi:1120:7
814-
|
815-
1118 | def __getitem__(self, key: int, /) -> str | int | None: ...
816-
1119 |
817-
1120 | class str(Sequence[str]):
818-
| ^^^
819-
1121 | """
820-
1122 | str(object='') -> str
821-
|
812+
--> stdlib/builtins.pyi:892:7
813+
|
814+
890 | def __getitem__(self, key: int, /) -> str | int | None: ...
815+
891 |
816+
892 | class str(Sequence[str]):
817+
| ^^^
818+
893 | """str(object='') -> str
819+
894 | str(bytes_or_buffer[, encoding[, errors]]) -> str
820+
|
822821
info: Source
823822
--> main.py:3:17
824823
|

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:221:5
32+
--> stdlib/json/__init__.pyi:219:5
3333
|
34-
219 | """
35-
220 |
36-
221 | def loads(
34+
217 | """
35+
218 |
36+
219 | def loads(
3737
| ^^^^^
38-
222 | s: str | bytes | bytearray,
38+
220 | s: str | bytes | bytearray,
3939
| -------------------------- Parameter declared here
40-
223 | *,
41-
224 | cls: type[JSONDecoder] | None = None,
40+
221 | *,
41+
222 | cls: type[JSONDecoder] | None = None,
4242
|
4343
info: rule `invalid-argument-type` is enabled by default
4444

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,13 @@ _VersionInfo: TypeAlias = tuple[int, int, int, str, int]
5555
class _Feature:
5656
def __init__(self, optionalRelease: _VersionInfo, mandatoryRelease: _VersionInfo | None, compiler_flag: int) -> None: ...
5757
def getOptionalRelease(self) -> _VersionInfo:
58-
"""
59-
Return first release in which this feature was recognized.
58+
"""Return first release in which this feature was recognized.
6059
6160
This is a 5-tuple, of the same form as sys.version_info.
6261
"""
6362

6463
def getMandatoryRelease(self) -> _VersionInfo | None:
65-
"""
66-
Return release in which this feature will become mandatory.
64+
"""Return release in which this feature will become mandatory.
6765
6866
This is a 5-tuple, of the same form as sys.version_info, or, if
6967
the feature was dropped, or the release date is undetermined, is None.

0 commit comments

Comments
 (0)