Skip to content

Sync typeshed #18930

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

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b5f2cc9633f9f6cd9326eee96a32efb3aff70701 Mon Sep 17 00:00:00 2001
From f12b57ec89a6431737e4f473cecabf0d350b0d46 Mon Sep 17 00:00:00 2001
From: Marc Mueller <[email protected]>
Date: Sat, 15 Feb 2025 20:11:06 +0100
Subject: [PATCH] Partially revert Clean up argparse hacks
Expand All @@ -8,7 +8,7 @@ Subject: [PATCH] Partially revert Clean up argparse hacks
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/mypy/typeshed/stdlib/argparse.pyi b/mypy/typeshed/stdlib/argparse.pyi
index 029bfeefe..9dbd8c308 100644
index 32beaff14..e97a2d2e1 100644
--- a/mypy/typeshed/stdlib/argparse.pyi
+++ b/mypy/typeshed/stdlib/argparse.pyi
@@ -2,7 +2,7 @@ import sys
Expand All @@ -20,7 +20,7 @@ index 029bfeefe..9dbd8c308 100644
from typing_extensions import Self, TypeAlias, deprecated

__all__ = [
@@ -38,7 +38,9 @@ ONE_OR_MORE: Final = "+"
@@ -36,7 +36,9 @@ ONE_OR_MORE: Final = "+"
OPTIONAL: Final = "?"
PARSER: Final = "A..."
REMAINDER: Final = "..."
Expand All @@ -31,7 +31,7 @@ index 029bfeefe..9dbd8c308 100644
ZERO_OR_MORE: Final = "*"
_UNRECOGNIZED_ARGS_ATTR: Final = "_unrecognized_args" # undocumented

@@ -81,7 +83,7 @@ class _ActionsContainer:
@@ -79,7 +81,7 @@ class _ActionsContainer:
# more precisely, Literal["?", "*", "+", "...", "A...", "==SUPPRESS=="],
# but using this would make it hard to annotate callers that don't use a
# literal argument and for subclasses to override this method.
Expand All @@ -41,5 +41,5 @@ index 029bfeefe..9dbd8c308 100644
default: Any = ...,
type: _ActionType = ...,
--
2.48.1
2.49.0

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
From b4259edd94188f9e4cc77a22e768eea183a32053 Mon Sep 17 00:00:00 2001
From d33ae9f29cc3ff83102dfa68c22ab2a459fbeb43 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)
Expand All @@ -8,18 +8,18 @@ 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 63c53a5f6..d55042b56 100644
index b75250aad..64d08dba0 100644
--- a/mypy/typeshed/stdlib/builtins.pyi
+++ b/mypy/typeshed/stdlib/builtins.pyi
@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022
@@ -62,7 +62,6 @@ from typing import ( # noqa: Y022,UP035
from typing_extensions import ( # noqa: Y023
Concatenate,
Literal,
- LiteralString,
ParamSpec,
Self,
TypeAlias,
@@ -438,31 +437,16 @@ class str(Sequence[str]):
@@ -440,31 +439,16 @@ class str(Sequence[str]):
def __new__(cls, object: object = ...) -> Self: ...
@overload
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
Expand Down Expand Up @@ -51,7 +51,7 @@ index 63c53a5f6..d55042b56 100644
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: ...
@@ -478,99 +462,35 @@ class str(Sequence[str]):
@@ -480,98 +464,34 @@ class str(Sequence[str]):
def isspace(self) -> bool: ...
def istitle(self) -> bool: ...
def isupper(self) -> bool: ...
Expand Down Expand Up @@ -89,16 +89,15 @@ index 63c53a5f6..d55042b56 100644
- ) -> LiteralString: ...
- @overload
def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str: ... # type: ignore[misc]
if sys.version_info >= (3, 9):
- @overload
- def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ...
- @overload
def removeprefix(self, prefix: str, /) -> str: ... # type: ignore[misc]
- @overload
- def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ...
- @overload
def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc]

- @overload
- def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ...
- @overload
def removeprefix(self, prefix: str, /) -> str: ... # type: ignore[misc]
- @overload
- 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: ...
- @overload
Expand Down Expand Up @@ -151,7 +150,7 @@ index 63c53a5f6..d55042b56 100644
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
@staticmethod
@overload
@@ -581,39 +501,21 @@ class str(Sequence[str]):
@@ -582,39 +502,21 @@ class str(Sequence[str]):
@staticmethod
@overload
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
Expand Down Expand Up @@ -193,5 +192,5 @@ index 63c53a5f6..d55042b56 100644
def __getnewargs__(self) -> tuple[str]: ...

--
2.47.0
2.49.0

Loading