-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Sync typeshed #20080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Sync typeshed #20080
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
5da076b
Update typeshed patches
cdce8p 78fea20
Sync typeshed
cdce8p cdcb45d
Partially revert Clean up argparse hacks
cdce8p 2b0f220
Remove use of LiteralString in builtins (#13743)
hauntsaninja 688913b
Revert Remove redundant inheritances from Iterator in builtins
cdce8p b42a9bd
Revert sum literal integer change (#13961)
hauntsaninja 8f26921
Revert typeshed ctypes change Since the plugin provides superior type…
AlexWaygood 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
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| From 805d7fc06a8bee350959512e0908a18a87b7f8c2 Mon Sep 17 00:00:00 2001 | ||
| From 3229a6066cff3d80d6cb923322c2d42a300d0be3 Mon Sep 17 00:00:00 2001 | ||
| From: Shantanu <[email protected]> | ||
| Date: Mon, 26 Sep 2022 12:55:07 -0700 | ||
| Subject: [PATCH] Remove use of LiteralString in builtins (#13743) | ||
|
|
@@ -8,7 +8,7 @@ Subject: [PATCH] Remove use of LiteralString in builtins (#13743) | |
| 1 file changed, 1 insertion(+), 99 deletions(-) | ||
|
|
||
| diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi | ||
| index c7ab95482..3e93da36e 100644 | ||
| index 969d16876..044e264d2 100644 | ||
| --- a/mypy/typeshed/stdlib/builtins.pyi | ||
| +++ b/mypy/typeshed/stdlib/builtins.pyi | ||
| @@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035 | ||
|
|
@@ -19,10 +19,10 @@ index c7ab95482..3e93da36e 100644 | |
| ParamSpec, | ||
| Self, | ||
| TypeAlias, | ||
| @@ -468,31 +467,16 @@ class str(Sequence[str]): | ||
| def __new__(cls, object: object = ...) -> Self: ... | ||
| @@ -480,31 +479,16 @@ class str(Sequence[str]): | ||
| def __new__(cls, object: object = "") -> Self: ... | ||
| @overload | ||
| def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ... | ||
| def __new__(cls, object: ReadableBuffer, encoding: str = "utf-8", errors: str = "strict") -> Self: ... | ||
| - @overload | ||
| - def capitalize(self: LiteralString) -> LiteralString: ... | ||
| - @overload | ||
|
|
@@ -35,23 +35,23 @@ index c7ab95482..3e93da36e 100644 | |
| - def center(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ... | ||
| - @overload | ||
| def center(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc] | ||
| def count(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... | ||
| def count(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ... | ||
| def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ... | ||
| def endswith( | ||
| self, suffix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / | ||
| self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, / | ||
| ) -> bool: ... | ||
| - @overload | ||
| - def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ... | ||
| - @overload | ||
| def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc] | ||
| def find(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... | ||
| def find(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ... | ||
| - @overload | ||
| - def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... | ||
| - @overload | ||
| def format(self, *args: object, **kwargs: object) -> str: ... | ||
| def format_map(self, mapping: _FormatMapMapping, /) -> str: ... | ||
| def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... | ||
| @@ -508,98 +492,34 @@ class str(Sequence[str]): | ||
| def index(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ... | ||
| @@ -520,98 +504,34 @@ class str(Sequence[str]): | ||
| def isspace(self) -> bool: ... | ||
| def istitle(self) -> bool: ... | ||
| def isupper(self) -> bool: ... | ||
|
|
@@ -98,8 +98,8 @@ index c7ab95482..3e93da36e 100644 | |
| - def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ... | ||
| - @overload | ||
| def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc] | ||
| def rfind(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... | ||
| def rindex(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ... | ||
| def rfind(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ... | ||
| def rindex(self, sub: str, start: SupportsIndex | None = None, end: SupportsIndex | None = None, /) -> int: ... | ||
| - @overload | ||
| - def rjust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ... | ||
| - @overload | ||
|
|
@@ -125,7 +125,7 @@ index c7ab95482..3e93da36e 100644 | |
| - @overload | ||
| def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc] | ||
| def startswith( | ||
| self, prefix: str | tuple[str, ...], start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., / | ||
| self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None, end: SupportsIndex | None = None, / | ||
| ) -> bool: ... | ||
| - @overload | ||
| - def strip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ... | ||
|
|
@@ -150,7 +150,7 @@ index c7ab95482..3e93da36e 100644 | |
| def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc] | ||
| @staticmethod | ||
| @overload | ||
| @@ -610,39 +530,21 @@ class str(Sequence[str]): | ||
| @@ -622,39 +542,21 @@ class str(Sequence[str]): | ||
| @staticmethod | ||
| @overload | ||
| def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ... | ||
|
|
@@ -192,5 +192,5 @@ index c7ab95482..3e93da36e 100644 | |
| def __getnewargs__(self) -> tuple[str]: ... | ||
| def __format__(self, format_spec: str, /) -> str: ... | ||
| -- | ||
| 2.50.1 | ||
| 2.51.1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| From 438dbb1300b77331940d7db8f010e97305745116 Mon Sep 17 00:00:00 2001 | ||
| From 7678bc3f80e4d3f04a0ff0ee3a7d51f49ae4c465 Mon Sep 17 00:00:00 2001 | ||
| From: Marc Mueller <[email protected]> | ||
| Date: Sat, 21 Dec 2024 22:36:38 +0100 | ||
| Subject: [PATCH] Revert Remove redundant inheritances from Iterator in | ||
|
|
@@ -36,10 +36,10 @@ index d663f5d93..f43178e4d 100644 | |
| @property | ||
| def _exception(self) -> BaseException | None: ... | ||
| diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi | ||
| index f2dd00079..784ee7eac 100644 | ||
| index 044e264d2..6d813f172 100644 | ||
| --- a/mypy/typeshed/stdlib/builtins.pyi | ||
| +++ b/mypy/typeshed/stdlib/builtins.pyi | ||
| @@ -1209,7 +1209,7 @@ class frozenset(AbstractSet[_T_co]): | ||
| @@ -1210,7 +1210,7 @@ class frozenset(AbstractSet[_T_co]): | ||
| def __class_getitem__(cls, item: Any, /) -> GenericAlias: ... | ||
|
|
||
| @disjoint_base | ||
|
|
@@ -48,7 +48,7 @@ index f2dd00079..784ee7eac 100644 | |
| def __new__(cls, iterable: Iterable[_T], start: int = 0) -> Self: ... | ||
| def __iter__(self) -> Self: ... | ||
| def __next__(self) -> tuple[int, _T]: ... | ||
| @@ -1405,7 +1405,7 @@ else: | ||
| @@ -1404,7 +1404,7 @@ else: | ||
| exit: _sitebuiltins.Quitter | ||
|
|
||
| @disjoint_base | ||
|
|
@@ -57,7 +57,7 @@ index f2dd00079..784ee7eac 100644 | |
| @overload | ||
| def __new__(cls, function: None, iterable: Iterable[_T | None], /) -> Self: ... | ||
| @overload | ||
| @@ -1469,7 +1469,7 @@ license: _sitebuiltins._Printer | ||
| @@ -1468,7 +1468,7 @@ license: _sitebuiltins._Printer | ||
|
|
||
| def locals() -> dict[str, Any]: ... | ||
| @disjoint_base | ||
|
|
@@ -66,7 +66,7 @@ index f2dd00079..784ee7eac 100644 | |
| # 3.14 adds `strict` argument. | ||
| if sys.version_info >= (3, 14): | ||
| @overload | ||
| @@ -1776,7 +1776,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex | ||
| @@ -1775,7 +1775,7 @@ def pow(base: _SupportsSomeKindOfPow, exp: complex, mod: None = None) -> complex | ||
| quit: _sitebuiltins.Quitter | ||
|
|
||
| @disjoint_base | ||
|
|
@@ -75,15 +75,15 @@ index f2dd00079..784ee7eac 100644 | |
| @overload | ||
| def __new__(cls, sequence: Reversible[_T], /) -> Iterator[_T]: ... # type: ignore[misc] | ||
| @overload | ||
| @@ -1840,7 +1840,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... | ||
| @@ -1839,7 +1839,7 @@ def vars(object: type, /) -> types.MappingProxyType[str, Any]: ... | ||
| @overload | ||
| def vars(object: Any = ..., /) -> dict[str, Any]: ... | ||
| @disjoint_base | ||
| -class zip(Generic[_T_co]): | ||
| +class zip(Iterator[_T_co]): | ||
| if sys.version_info >= (3, 10): | ||
| @overload | ||
| def __new__(cls, *, strict: bool = ...) -> zip[Any]: ... | ||
| def __new__(cls, *, strict: bool = False) -> zip[Any]: ... | ||
| diff --git a/mypy/typeshed/stdlib/csv.pyi b/mypy/typeshed/stdlib/csv.pyi | ||
| index 2c8e7109c..4ed0ab1d8 100644 | ||
| --- a/mypy/typeshed/stdlib/csv.pyi | ||
|
|
@@ -326,5 +326,5 @@ index 6b0f1ba94..882cd143c 100644 | |
| @property | ||
| def connection(self) -> Connection: ... | ||
| -- | ||
| 2.51.0 | ||
| 2.51.1 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.