Skip to content

Commit 946c1bf

Browse files
authored
Sync typeshed (python#17971)
Source commit: python/typeshed@2370b8b
1 parent c201a18 commit 946c1bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+4655
-3349
lines changed

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

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
From 3ec9b878d6bbe3fae64a508a62372f10a886406f Mon Sep 17 00:00:00 2001
1+
From b4259edd94188f9e4cc77a22e768eea183a32053 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)
55

66
---
7-
mypy/typeshed/stdlib/builtins.pyi | 95 -------------------------------
8-
1 file changed, 95 deletions(-)
7+
mypy/typeshed/stdlib/builtins.pyi | 100 +-----------------------------
8+
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 53e00ec6a..bad3250ef 100644
11+
index 63c53a5f6..d55042b56 100644
1212
--- a/mypy/typeshed/stdlib/builtins.pyi
1313
+++ b/mypy/typeshed/stdlib/builtins.pyi
14-
@@ -61,7 +61,6 @@ from typing import ( # noqa: Y022
14+
@@ -63,7 +63,6 @@ from typing import ( # noqa: Y022
1515
from typing_extensions import ( # noqa: Y023
1616
Concatenate,
1717
Literal,
1818
- LiteralString,
1919
ParamSpec,
2020
Self,
2121
TypeAlias,
22-
@@ -435,31 +434,16 @@ class str(Sequence[str]):
22+
@@ -438,31 +437,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 53e00ec6a..bad3250ef 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-
@@ -475,99 +459,35 @@ class str(Sequence[str]):
54+
@@ -478,99 +462,35 @@ class str(Sequence[str]):
5555
def isspace(self) -> bool: ...
5656
def istitle(self) -> bool: ...
5757
def isupper(self) -> bool: ...
@@ -151,7 +151,7 @@ index 53e00ec6a..bad3250ef 100644
151151
def zfill(self, width: SupportsIndex, /) -> str: ... # type: ignore[misc]
152152
@staticmethod
153153
@overload
154-
@@ -578,9 +498,6 @@ class str(Sequence[str]):
154+
@@ -581,39 +501,21 @@ class str(Sequence[str]):
155155
@staticmethod
156156
@overload
157157
def maketrans(x: str, y: str, z: str, /) -> dict[int, int | None]: ...
@@ -161,8 +161,13 @@ index 53e00ec6a..bad3250ef 100644
161161
def __add__(self, value: str, /) -> str: ... # type: ignore[misc]
162162
# Incompatible with Sequence.__contains__
163163
def __contains__(self, key: str, /) -> bool: ... # type: ignore[override]
164-
@@ -589,25 +506,13 @@ class str(Sequence[str]):
165-
def __getitem__(self, key: SupportsIndex | slice, /) -> str: ...
164+
def __eq__(self, value: object, /) -> bool: ...
165+
def __ge__(self, value: str, /) -> bool: ...
166+
- @overload
167+
- def __getitem__(self: LiteralString, key: SupportsIndex | slice, /) -> LiteralString: ...
168+
- @overload
169+
- def __getitem__(self, key: SupportsIndex | slice, /) -> str: ... # type: ignore[misc]
170+
+ def __getitem__(self, key: SupportsIndex | slice, /) -> str: ...
166171
def __gt__(self, value: str, /) -> bool: ...
167172
def __hash__(self) -> int: ...
168173
- @overload
@@ -188,5 +193,5 @@ index 53e00ec6a..bad3250ef 100644
188193
def __getnewargs__(self) -> tuple[str]: ...
189194

190195
--
191-
2.45.2
196+
2.47.0
192197

mypy/typeshed/stdlib/VERSIONS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
__future__: 3.0-
2121
__main__: 3.0-
2222
_ast: 3.0-
23+
_asyncio: 3.0-
2324
_bisect: 3.0-
2425
_bootlocale: 3.4-3.9
2526
_codecs: 3.0-
@@ -37,6 +38,7 @@ _imp: 3.0-
3738
_interpchannels: 3.13-
3839
_interpqueues: 3.13-
3940
_interpreters: 3.13-
41+
_io: 3.0-
4042
_json: 3.0-
4143
_locale: 3.0-
4244
_lsprof: 3.0-
@@ -50,6 +52,8 @@ _pydecimal: 3.5-
5052
_random: 3.0-
5153
_sitebuiltins: 3.4-
5254
_socket: 3.0- # present in 3.0 at runtime, but not in typeshed
55+
_sqlite3: 3.0-
56+
_ssl: 3.0-
5357
_stat: 3.4-
5458
_thread: 3.0-
5559
_threading_local: 3.0-

0 commit comments

Comments
 (0)