1- From 805d7fc06a8bee350959512e0908a18a87b7f8c2 Mon Sep 17 00:00:00 2001
1+ From 3229a6066cff3d80d6cb923322c2d42a300d0be3 Mon Sep 17 00:00:00 2001
22From: Shantanu <
[email protected] >
33Date: Mon, 26 Sep 2022 12:55:07 -0700
44Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
@@ -8,7 +8,7 @@ Subject: [PATCH] Remove use of LiteralString in builtins (#13743)
88 1 file changed, 1 insertion(+), 99 deletions(-)
99
1010diff --git a/mypy/typeshed/stdlib/builtins.pyi b/mypy/typeshed/stdlib/builtins.pyi
11- index c7ab95482..3e93da36e 100644
11+ index 969d16876..044e264d2 100644
1212--- a/mypy/typeshed/stdlib/builtins.pyi
1313+++ b/mypy/typeshed/stdlib/builtins.pyi
1414@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022,UP035
@@ -19,10 +19,10 @@ index c7ab95482..3e93da36e 100644
1919 ParamSpec,
2020 Self,
2121 TypeAlias,
22- @@ -468 ,31 +467 ,16 @@ class str(Sequence[str]):
23- def __new__(cls, object: object = ... ) -> Self: ...
22+ @@ -480 ,31 +479 ,16 @@ class str(Sequence[str]):
23+ def __new__(cls, object: object = "" ) -> Self: ...
2424 @overload
25- def __new__(cls, object: ReadableBuffer, encoding: str = ... , errors: str = ... ) -> Self: ...
25+ def __new__(cls, object: ReadableBuffer, encoding: str = "utf-8" , errors: str = "strict" ) -> Self: ...
2626- @overload
2727- def capitalize(self: LiteralString) -> LiteralString: ...
2828- @overload
@@ -35,23 +35,23 @@ index c7ab95482..3e93da36e 100644
3535- def center(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ...
3636- @overload
3737 def center(self, width: SupportsIndex, fillchar: str = " ", /) -> str: ... # type: ignore[misc]
38- def count(self, sub: str, start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /) -> int: ...
38+ def count(self, sub: str, start: SupportsIndex | None = None , end: SupportsIndex | None = None , /) -> int: ...
3939 def encode(self, encoding: str = "utf-8", errors: str = "strict") -> bytes: ...
4040 def endswith(
41- self, suffix: str | tuple[str, ...], start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /
41+ self, suffix: str | tuple[str, ...], start: SupportsIndex | None = None , end: SupportsIndex | None = None , /
4242 ) -> bool: ...
4343- @overload
4444- def expandtabs(self: LiteralString, tabsize: SupportsIndex = 8) -> LiteralString: ...
4545- @overload
4646 def expandtabs(self, tabsize: SupportsIndex = 8) -> str: ... # type: ignore[misc]
47- def find(self, sub: str, start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /) -> int: ...
47+ def find(self, sub: str, start: SupportsIndex | None = None , end: SupportsIndex | None = None , /) -> int: ...
4848- @overload
4949- def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ...
5050- @overload
5151 def format(self, *args: object, **kwargs: object) -> str: ...
5252 def format_map(self, mapping: _FormatMapMapping, /) -> str: ...
53- def index(self, sub: str, start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /) -> int: ...
54- @@ -508 ,98 +492 ,34 @@ class str(Sequence[str]):
53+ def index(self, sub: str, start: SupportsIndex | None = None , end: SupportsIndex | None = None , /) -> int: ...
54+ @@ -520 ,98 +504 ,34 @@ class str(Sequence[str]):
5555 def isspace(self) -> bool: ...
5656 def istitle(self) -> bool: ...
5757 def isupper(self) -> bool: ...
@@ -98,8 +98,8 @@ index c7ab95482..3e93da36e 100644
9898- def removesuffix(self: LiteralString, suffix: LiteralString, /) -> LiteralString: ...
9999- @overload
100100 def removesuffix(self, suffix: str, /) -> str: ... # type: ignore[misc]
101- def rfind(self, sub: str, start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /) -> int: ...
102- def rindex(self, sub: str, start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /) -> int: ...
101+ def rfind(self, sub: str, start: SupportsIndex | None = None , end: SupportsIndex | None = None , /) -> int: ...
102+ def rindex(self, sub: str, start: SupportsIndex | None = None , end: SupportsIndex | None = None , /) -> int: ...
103103- @overload
104104- def rjust(self: LiteralString, width: SupportsIndex, fillchar: LiteralString = " ", /) -> LiteralString: ...
105105- @overload
@@ -125,7 +125,7 @@ index c7ab95482..3e93da36e 100644
125125- @overload
126126 def splitlines(self, keepends: bool = False) -> list[str]: ... # type: ignore[misc]
127127 def startswith(
128- self, prefix: str | tuple[str, ...], start: SupportsIndex | None = ... , end: SupportsIndex | None = ... , /
128+ self, prefix: str | tuple[str, ...], start: SupportsIndex | None = None , end: SupportsIndex | None = None , /
129129 ) -> bool: ...
130130- @overload
131131- def strip(self: LiteralString, chars: LiteralString | None = None, /) -> LiteralString: ...
@@ -150,7 +150,7 @@ index c7ab95482..3e93da36e 100644
150150 def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
151151 @staticmethod
152152 @overload
153- @@ -610 ,39 +530 ,21 @@ class str(Sequence[str]):
153+ @@ -622 ,39 +542 ,21 @@ class str(Sequence[str]):
154154 @staticmethod
155155 @overload
156156 def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
@@ -192,5 +192,5 @@ index c7ab95482..3e93da36e 100644
192192 def __getnewargs__(self) -> tuple[str]: ...
193193 def __format__(self, format_spec: str, /) -> str: ...
194194- -
195- 2.50 .1
195+ 2.51 .1
196196
0 commit comments