Skip to content

Commit 6b117ae

Browse files
committed
Update typeshed patch for LiteralString
1 parent a3ce6d5 commit 6b117ae

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

misc/typeshed_patches/0001-Remove-use-of-LiteralString-in-builtins-13743.patch

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
From b4259edd94188f9e4cc77a22e768eea183a32053 Mon Sep 17 00:00:00 2001
1+
From d33ae9f29cc3ff83102dfa68c22ab2a459fbeb43 Mon Sep 17 00:00:00 2001
22
From: Shantanu <[email protected]>
33
Date: Mon, 26 Sep 2022 12:55:07 -0700
44
Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
@@ -8,18 +8,18 @@ Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
88
1 file changed, 1 insertion(+), 99 deletions(-)
99

1010
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
11-
index 63c53a5f6..d55042b56 100644
11+
index b75250aad..64d08dba0 100644
1212
--- a/mypy/typeshed/stdlib/builtins.pyi
1313
+++ b/mypy/typeshed/stdlib/builtins.pyi
14-
@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022
14+
@@ -62,7 +62,6 @@ from typing import ( # noqa: Y022,UP035
1515
from typing_extensions import ( # noqa: Y023
1616
Concatenate,
1717
Literal,
1818
- LiteralString,
1919
ParamSpec,
2020
Self,
2121
TypeAlias,
22-
@@ -438,31 +437,16 @@ class str(Sequence[str]):
22+
@@ -440,31 +439,16 @@ class str(Sequence[str]):
2323
def __new__(cls, object: object = ...) -> Self: ...
2424
@overload
2525
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
@@ -51,7 +51,7 @@ index 63c53a5f6..d55042b56 100644
5151
def format(self, *args: object, **kwargs: object) -> str: ...
5252
def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
5353
def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
54-
@@ -478,99 +462,35 @@ class str(Sequence[str]):
54+
@@ -480,98 +464,34 @@ class str(Sequence[str]):
5555
def isspace(self) -> bool: ...
5656
def istitle(self) -> bool: ...
5757
def isupper(self) -> bool: ...
@@ -89,16 +89,15 @@ index 63c53a5f6..d55042b56 100644
8989
- ) -> LiteralString: ...
9090
- @overload
9191
def replace(self, old: str, new: str, count: SupportsIndex = -1, /) -> str: ... # type: ignore[misc]
92-
if sys.version_info >= (3, 9):
93-
- @overload
94-
- def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ...
95-
- @overload
96-
def removeprefix(self, prefix: str, /) -> str: ... # type: ignore[misc]
97-
- @overload
98-
- def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ...
99-
- @overload
100-
def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc]
10192

93+
- @overload
94+
- def removeprefix(self: LiteralString, prefix: LiteralString, /) -> LiteralString: ...
95+
- @overload
96+
def removeprefix(self, prefix: str, /) -> str: ... # type: ignore[misc]
97+
- @overload
98+
- def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ...
99+
- @overload
100+
def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc]
102101
def rfind(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
103102
def rindex(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
104103
- @overload
@@ -151,7 +150,7 @@ index 63c53a5f6..d55042b56 100644
151150
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
152151
@staticmethod
153152
@overload
154-
@@ -581,39 +501,21 @@ class str(Sequence[str]):
153+
@@ -582,39 +502,21 @@ class str(Sequence[str]):
155154
@staticmethod
156155
@overload
157156
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
@@ -193,5 +192,5 @@ index 63c53a5f6..d55042b56 100644
193192
def __getnewargs__(self) -> tuple[str]: ...
194193

195194
--
196-
2.47.0
195+
2.49.0
197196

0 commit comments

Comments
 (0)