Skip to content

Commit 53a8193

Browse files
srittauAlexWaygood
andauthored
Update typing_extensions imports in stdlib (#11244)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
1 parent b6eaadc commit 53a8193

214 files changed

Lines changed: 365 additions & 430 deletions

File tree

Some content is hidden

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

stdlib/_ast.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import sys
22
import typing_extensions
3-
from typing import Any, ClassVar
4-
from typing_extensions import Literal
3+
from typing import Any, ClassVar, Literal
54

65
PyCF_ONLY_AST: Literal[1024]
76
PyCF_TYPE_COMMENTS: Literal[4096]

stdlib/_codecs.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import codecs
22
import sys
33
from _typeshed import ReadableBuffer
44
from collections.abc import Callable
5-
from typing import overload
6-
from typing_extensions import Literal, TypeAlias
5+
from typing import Literal, overload
6+
from typing_extensions import TypeAlias
77

88
# This type is not exposed; it is defined in unicodeobject.c
99
class _EncodingMap:

stdlib/_collections_abc.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ from typing import ( # noqa: Y022,Y038,Y057
3030
Sized as Sized,
3131
TypeVar,
3232
ValuesView as ValuesView,
33+
final,
3334
runtime_checkable,
3435
)
35-
from typing_extensions import final
3636

3737
__all__ = [
3838
"Awaitable",

stdlib/_csv.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22
from _typeshed import SupportsWrite
33
from collections.abc import Iterable, Iterator
4-
from typing import Any
5-
from typing_extensions import Final, Literal, TypeAlias
4+
from typing import Any, Final, Literal
5+
from typing_extensions import TypeAlias
66

77
__version__: Final[str]
88

stdlib/_curses.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _typeshed import ReadOnlyBuffer, SupportsRead
3-
from typing import IO, Any, NamedTuple, overload
4-
from typing_extensions import TypeAlias, final
3+
from typing import IO, Any, NamedTuple, final, overload
4+
from typing_extensions import TypeAlias
55

66
if sys.platform != "win32":
77
# Handled by PyCurses_ConvertToChtype in _cursesmodule.c.

stdlib/_decimal.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import numbers
22
import sys
33
from collections.abc import Container, Sequence
44
from types import TracebackType
5-
from typing import Any, ClassVar, NamedTuple, overload
6-
from typing_extensions import Final, Literal, Self, TypeAlias
5+
from typing import Any, ClassVar, Final, Literal, NamedTuple, overload
6+
from typing_extensions import Self, TypeAlias
77

88
_Decimal: TypeAlias = Decimal | int
99
_DecimalNew: TypeAlias = Decimal | float | str | tuple[int, Sequence[int], int]

stdlib/_heapq.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from typing import Any, TypeVar
2-
from typing_extensions import Final
1+
from typing import Any, Final, TypeVar
32

43
_T = TypeVar("_T")
54

stdlib/_json.pyi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from collections.abc import Callable
2-
from typing import Any
3-
from typing_extensions import final
2+
from typing import Any, final
43

54
@final
65
class make_encoder:

stdlib/_operator.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import sys
22
from _typeshed import SupportsGetItem
33
from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence
4-
from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, TypeVar, overload
5-
from typing_extensions import ParamSpec, SupportsIndex, TypeAlias, TypeVarTuple, Unpack, final
4+
from typing import Any, AnyStr, Generic, Protocol, SupportsAbs, SupportsIndex, TypeVar, final, overload
5+
from typing_extensions import ParamSpec, TypeAlias, TypeVarTuple, Unpack
66

77
_R = TypeVar("_R")
88
_T = TypeVar("_T")

stdlib/_posixsubprocess.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22
from _typeshed import StrOrBytesPath
33
from collections.abc import Callable, Sequence
4-
from typing_extensions import SupportsIndex
4+
from typing import SupportsIndex
55

66
if sys.platform != "win32":
77
def cloexec_pipe() -> tuple[int, int]: ...

0 commit comments

Comments
 (0)