1
- From b4259edd94188f9e4cc77a22e768eea183a32053 Mon Sep 17 00:00:00 2001
1
+ From e6995c91231e1915eba43a29a22dd4cbfaf9e08e Mon Sep 17 00:00:00 2001
2
2
From: Shantanu <
[email protected] >
3
3
Date: Mon, 26 Sep 2022 12:55:07 -0700
4
4
Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
@@ -8,18 +8,18 @@ Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
8
8
1 file changed, 1 insertion(+), 99 deletions(-)
9
9
10
10
diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
11
- index 63c53a5f6..d55042b56 100644
11
+ index 00728f42d..ea77a730f 100644
12
12
--- a/mypy/typeshed/stdlib/builtins.pyi
13
13
+++ b/mypy/typeshed/stdlib/builtins.pyi
14
- @@ -63,7 +63,6 @@ from typing import ( # noqa: Y022
14
+ @@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035
15
15
from typing_extensions import ( # noqa: Y023
16
16
Concatenate,
17
17
Literal,
18
18
- LiteralString,
19
19
ParamSpec,
20
20
Self,
21
21
TypeAlias,
22
- @@ -438 ,31 +437 ,16 @@ class str(Sequence[str]):
22
+ @@ -453 ,31 +452 ,16 @@ class str(Sequence[str]):
23
23
def __new__(cls, object: object = ...) -> Self: ...
24
24
@overload
25
25
def __new__(cls, object: ReadableBuffer, encoding: str = ..., errors: str = ...) -> Self: ...
@@ -51,7 +51,7 @@ index 63c53a5f6..d55042b56 100644
51
51
def format(self, *args: object, **kwargs: object) -> str: ...
52
52
def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
53
53
def index(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
54
- @@ -478,99 +462,35 @@ class str(Sequence[str]):
54
+ @@ -493,98 +477,34 @@ class str(Sequence[str]):
55
55
def isspace(self) -> bool: ...
56
56
def istitle(self) -> bool: ...
57
57
def isupper(self) -> bool: ...
@@ -89,16 +89,15 @@ index 63c53a5f6..d55042b56 100644
89
89
- ) -> LiteralString: ...
90
90
- @overload
91
91
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]
101
92
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]
102
101
def rfind(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
103
102
def rindex(self, sub: str, start: SupportsIndex | None = ..., end: SupportsIndex | None = ..., /) -> int: ...
104
103
- @overload
@@ -151,7 +150,7 @@ index 63c53a5f6..d55042b56 100644
151
150
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
152
151
@staticmethod
153
152
@overload
154
- @@ -581 ,39 +501 ,21 @@ class str(Sequence[str]):
153
+ @@ -595 ,39 +515 ,21 @@ class str(Sequence[str]):
155
154
@staticmethod
156
155
@overload
157
156
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
@@ -193,5 +192,5 @@ index 63c53a5f6..d55042b56 100644
193
192
def __getnewargs__(self) -> tuple[str]: ...
194
193
195
194
- -
196
- 2.47 .0
195
+ 2.49 .0
197
196
0 commit comments