Skip to content

Sync typeshed #17971

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 6 commits into from
Oct 17, 2024
Merged
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,25 +1,25 @@
From 3ec9b878d6bbe3fae64a508a62372f10a886406f Mon Sep 17 00:00:00 2001
From b4259edd94188f9e4cc77a22e768eea183a32053 Mon Sep 17 00:00:00 2001
From: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Date: Mon, 26 Sep 2022 12:55:07 -0700
Subject: [PATCH] Remove use of LiteralString in builtins (#13743)

---
mypy/typeshed/stdlib/builtins.pyi | 95 -------------------------------
1 file changed, 95 deletions(-)
mypy/typeshed/stdlib/builtins.pyi | 100 +-----------------------------
1 file changed, 1 insertion(+), 99 deletions(-)

diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
index 53e00ec6a..bad3250ef 100644
index 63c53a5f6..d55042b56 100644
--- a/mypy/typeshed/stdlib/builtins.pyi
+++ b/mypy/typeshed/stdlib/builtins.pyi
@@ -61,7 +61,6 @@ from typing import ( # noqa: Y022
@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022
from typing_extensions import ( # noqa: Y023
Concatenate,
Literal,
- LiteralString,
ParamSpec,
Self,
TypeAlias,
@@ -435,31 +434,16 @@ class str(Sequence[str]):
@@ -438,31 +437,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 53e00ec6a..bad3250ef 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: ...
@@ -475,99 +459,35 @@ class str(Sequence[str]):
@@ -478,99 +462,35 @@ class str(Sequence[str]):
def isspace(self) -> bool: ...
def istitle(self) -> bool: ...
def isupper(self) -> bool: ...
Expand Down Expand Up @@ -151,7 +151,7 @@ index 53e00ec6a..bad3250ef 100644
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
@staticmethod
@overload
@@ -578,9 +498,6 @@ class str(Sequence[str]):
@@ -581,39 +501,21 @@ class str(Sequence[str]):
@staticmethod
@overload
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
Expand All @@ -161,8 +161,13 @@ index 53e00ec6a..bad3250ef 100644
def __add__(self, value: str, /) -> str: ... # type: ignore[misc]
# Incompatible with Sequence.__contains__
def __contains__(self, key: str, /) -> bool: ... # type: ignore[override]
@@ -589,25 +506,13 @@ class str(Sequence[str]):
def __getitem__(self, key: SupportsIndex | slice, /) -> str: ...
def __eq__(self, value: object, /) -> bool: ...
def __ge__(self, value: str, /) -> bool: ...
- @overload
- def __getitem__(self: LiteralString, key: SupportsIndex | slice, /) -> LiteralString: ...
- @overload
- def __getitem__(self, key: SupportsIndex | slice, /) -> str: ... # type: ignore[misc]
+ def __getitem__(self, key: SupportsIndex | slice, /) -> str: ...
def __gt__(self, value: str, /) -> bool: ...
def __hash__(self) -> int: ...
- @overload
Expand All @@ -188,5 +193,5 @@ index 53e00ec6a..bad3250ef 100644
def __getnewargs__(self) -> tuple[str]: ...

--
2.45.2
2.47.0

4 changes: 4 additions & 0 deletions mypy/typeshed/stdlib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
__future__: 3.0-
__main__: 3.0-
_ast: 3.0-
_asyncio: 3.0-
_bisect: 3.0-
_bootlocale: 3.4-3.9
_codecs: 3.0-
Expand All @@ -37,6 +38,7 @@ _imp: 3.0-
_interpchannels: 3.13-
_interpqueues: 3.13-
_interpreters: 3.13-
_io: 3.0-
_json: 3.0-
_locale: 3.0-
_lsprof: 3.0-
Expand All @@ -50,6 +52,8 @@ _pydecimal: 3.5-
_random: 3.0-
_sitebuiltins: 3.4-
_socket: 3.0- # present in 3.0 at runtime, but not in typeshed
_sqlite3: 3.0-
_ssl: 3.0-
_stat: 3.4-
_thread: 3.0-
_threading_local: 3.0-
Expand Down
Loading
Loading