Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 1 addition & 2 deletions lib/ts_utils/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
from collections.abc import Mapping
from dataclasses import dataclass
from pathlib import Path
from typing import Annotated, Any, Final, NamedTuple, cast, final
from typing_extensions import TypeGuard
from typing import Annotated, Any, Final, NamedTuple, TypeGuard, cast, final

if sys.version_info >= (3, 11):
import tomllib
Expand Down
3 changes: 1 addition & 2 deletions lib/ts_utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
from collections.abc import Iterable, Mapping
from pathlib import Path
from types import MethodType
from typing import TYPE_CHECKING, Any, Final, NamedTuple
from typing_extensions import TypeAlias
from typing import TYPE_CHECKING, Any, Final, NamedTuple, TypeAlias

import pathspec
from packaging.requirements import Requirement
Expand Down
4 changes: 2 additions & 2 deletions scripts/stubsabot.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
from dataclasses import dataclass, field
from http import HTTPStatus
from pathlib import Path
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypedDict, TypeVar
from typing_extensions import Self, TypeAlias
from typing import Annotated, Any, ClassVar, Literal, NamedTuple, TypeAlias, TypedDict, TypeVar
from typing_extensions import Self

if sys.version_info >= (3, 11):
import tomllib
Expand Down
4 changes: 2 additions & 2 deletions stdlib/@tests/test_cases/check_functools.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from __future__ import annotations

from functools import cache, cached_property, lru_cache, wraps
from typing import Callable, TypeVar
from typing_extensions import ParamSpec, assert_type
from typing import Callable, ParamSpec, TypeVar
from typing_extensions import assert_type

P = ParamSpec("P")
T_co = TypeVar("T_co", covariant=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,12 @@
Sequence,
Tuple,
Type,
TypeAlias,
TypeVar,
Union,
overload,
)
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
from typing_extensions import TypeVarTuple, Unpack

_T = TypeVar("_T")
_T1 = TypeVar("_T1")
Expand Down
2 changes: 1 addition & 1 deletion stdlib/__future__.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing_extensions import TypeAlias
from typing import TypeAlias

_VersionInfo: TypeAlias = tuple[int, int, int, str, int]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_asyncio.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ from asyncio.events import AbstractEventLoop
from collections.abc import Awaitable, Callable, Coroutine, Generator
from contextvars import Context
from types import FrameType, GenericAlias
from typing import Any, Literal, TextIO, TypeVar
from typing_extensions import Self, TypeAlias, disjoint_base
from typing import Any, Literal, TextIO, TypeAlias, TypeVar
from typing_extensions import Self, disjoint_base

_T = TypeVar("_T")
_T_co = TypeVar("_T_co", covariant=True)
Expand Down
3 changes: 1 addition & 2 deletions stdlib/_codecs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import codecs
import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable
from typing import Literal, final, overload, type_check_only
from typing_extensions import TypeAlias
from typing import Literal, TypeAlias, final, overload, type_check_only

# This type is not exposed; it is defined in unicodeobject.c
# At runtime it calls itself builtins.EncodingMap
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_contextvars.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from collections.abc import Callable, Iterator, Mapping
from types import GenericAlias, TracebackType
from typing import Any, ClassVar, Generic, TypeVar, final, overload
from typing_extensions import ParamSpec, Self
from typing import Any, ClassVar, Generic, ParamSpec, TypeVar, final, overload
from typing_extensions import Self

_T = TypeVar("_T")
_D = TypeVar("_D")
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_csv.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import csv
import sys
from _typeshed import SupportsWrite
from collections.abc import Iterable
from typing import Any, Final, Literal
from typing_extensions import Self, TypeAlias, disjoint_base
from typing import Any, Final, Literal, TypeAlias
from typing_extensions import Self, disjoint_base

__version__: Final[str]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_ctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ from abc import abstractmethod
from collections.abc import Callable, Iterable, Iterator, Mapping, Sequence
from ctypes import CDLL, ArgumentError as ArgumentError, c_void_p
from types import GenericAlias
from typing import Any, ClassVar, Final, Generic, Literal, SupportsIndex, TypeVar, final, overload, type_check_only
from typing_extensions import Self, TypeAlias
from typing import Any, ClassVar, Final, Generic, Literal, SupportsIndex, TypeAlias, TypeVar, final, overload, type_check_only
from typing_extensions import Self

_T = TypeVar("_T")
_CT = TypeVar("_CT", bound=_CData)
Expand Down
3 changes: 1 addition & 2 deletions stdlib/_curses.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import sys
from _typeshed import ReadOnlyBuffer, SupportsRead, SupportsWrite
from curses import _ncurses_version
from typing import Any, Final, final, overload
from typing_extensions import TypeAlias
from typing import Any, Final, TypeAlias, final, overload

# NOTE: This module is ordinarily only available on Unix, but the windows-curses
# package makes it available on Windows as well with the same contents.
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_dbm.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from _typeshed import ReadOnlyBuffer, StrOrBytesPath
from types import TracebackType
from typing import Final, TypeVar, final, overload, type_check_only
from typing_extensions import Self, TypeAlias
from typing import Final, TypeAlias, TypeVar, final, overload, type_check_only
from typing_extensions import Self

if sys.platform != "win32":
_T = TypeVar("_T")
Expand Down
3 changes: 1 addition & 2 deletions stdlib/_decimal.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ from decimal import (
Underflow as Underflow,
_ContextManager,
)
from typing import Final
from typing_extensions import TypeAlias
from typing import Final, TypeAlias

_TrapType: TypeAlias = type[DecimalException]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_gdbm.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from _typeshed import ReadOnlyBuffer, StrOrBytesPath
from types import TracebackType
from typing import TypeVar, overload, type_check_only
from typing_extensions import Self, TypeAlias
from typing import TypeAlias, TypeVar, overload, type_check_only
from typing_extensions import Self

if sys.platform != "win32":
_T = TypeVar("_T")
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_hashlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import sys
from _typeshed import ReadableBuffer
from collections.abc import Callable
from types import ModuleType
from typing import AnyStr, Protocol, final, overload, type_check_only
from typing_extensions import Self, TypeAlias, disjoint_base
from typing import AnyStr, Protocol, TypeAlias, final, overload, type_check_only
from typing_extensions import Self, disjoint_base

_DigestMod: TypeAlias = str | Callable[[], _HashObject] | ModuleType | None

Expand Down
3 changes: 1 addition & 2 deletions stdlib/_interpqueues.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Any, Literal, SupportsIndex
from typing_extensions import TypeAlias
from typing import Any, Literal, SupportsIndex, TypeAlias

_UnboundOp: TypeAlias = Literal[1, 2, 3]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_interpreters.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import types
from collections.abc import Callable
from typing import Any, Final, Literal, SupportsIndex, TypeVar, overload
from typing_extensions import TypeAlias, disjoint_base
from typing import Any, Final, Literal, SupportsIndex, TypeAlias, TypeVar, overload
from typing_extensions import disjoint_base

_R = TypeVar("_R")

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_lzma.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from _typeshed import ReadableBuffer
from collections.abc import Mapping, Sequence
from typing import Any, Final, final
from typing_extensions import Self, TypeAlias
from typing import Any, Final, TypeAlias, final
from typing_extensions import Self

_FilterChain: TypeAlias = Sequence[Mapping[str, Any]]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/_operator.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ from _typeshed import (
)
from collections.abc import Callable, Container, Iterable, MutableMapping, MutableSequence, Sequence
from operator import attrgetter as attrgetter, itemgetter as itemgetter, methodcaller as methodcaller
from typing import Any, AnyStr, Protocol, SupportsAbs, SupportsIndex, TypeVar, overload, type_check_only
from typing_extensions import ParamSpec, TypeAlias, TypeIs
from typing import Any, AnyStr, ParamSpec, Protocol, SupportsAbs, SupportsIndex, TypeAlias, TypeVar, overload, type_check_only
from typing_extensions import TypeIs

_R = TypeVar("_R")
_T = TypeVar("_T")
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_pickle.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from _typeshed import ReadableBuffer, SupportsWrite
from collections.abc import Callable, Iterable, Iterator, Mapping
from pickle import PickleBuffer as PickleBuffer
from typing import Any, Protocol, type_check_only
from typing_extensions import TypeAlias, disjoint_base
from typing import Any, Protocol, TypeAlias, type_check_only
from typing_extensions import disjoint_base

@type_check_only
class _ReadableFileobj(Protocol):
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_random.pyi
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing_extensions import TypeAlias, disjoint_base
from typing import TypeAlias
from typing_extensions import disjoint_base

# Actually Tuple[(int,) * 625]
_State: TypeAlias = tuple[int, ...]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import sys
from _typeshed import ReadableBuffer, WriteableBuffer
from collections.abc import Iterable
from socket import error as error, gaierror as gaierror, herror as herror, timeout as timeout
from typing import Any, Final, SupportsIndex, overload
from typing_extensions import CapsuleType, TypeAlias, disjoint_base
from typing import Any, Final, SupportsIndex, TypeAlias, overload
from typing_extensions import CapsuleType, disjoint_base

_CMSG: TypeAlias = tuple[int, int, bytes]
_CMSGArg: TypeAlias = tuple[int, int, ReadableBuffer]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_sqlite3.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ from sqlite3 import (
Warning as Warning,
_IsolationLevel,
)
from typing import Any, Final, Literal, TypeVar, overload
from typing_extensions import TypeAlias, deprecated
from typing import Any, Final, Literal, TypeAlias, TypeVar, overload
from typing_extensions import deprecated

if sys.version_info >= (3, 11):
from sqlite3 import Blob as Blob
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_ssl.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ from ssl import (
SSLWantWriteError as SSLWantWriteError,
SSLZeroReturnError as SSLZeroReturnError,
)
from typing import Any, ClassVar, Final, Literal, TypedDict, final, overload, type_check_only
from typing_extensions import NotRequired, Self, TypeAlias, deprecated, disjoint_base
from typing import Any, ClassVar, Final, Literal, TypeAlias, TypedDict, final, overload, type_check_only
from typing_extensions import NotRequired, Self, deprecated, disjoint_base

_PasswordType: TypeAlias = Callable[[], str | bytes | bytearray] | str | bytes | bytearray
_PCTRTT: TypeAlias = tuple[tuple[str, str], ...]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_threading_local.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from threading import RLock
from typing import Any
from typing_extensions import Self, TypeAlias
from typing import Any, TypeAlias
from typing_extensions import Self
from weakref import ReferenceType

__all__ = ["local"]
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_tkinter.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import sys
from _typeshed import FileDescriptorLike, Incomplete
from collections.abc import Callable
from typing import Any, ClassVar, Final, Literal, final, overload
from typing_extensions import TypeAlias, deprecated
from typing import Any, ClassVar, Final, Literal, TypeAlias, final, overload
from typing_extensions import deprecated

# _tkinter is meant to be only used internally by tkinter, but some tkinter
# functions e.g. return _tkinter.Tcl_Obj objects. Tcl_Obj represents a Tcl
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_typeshed/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ from typing import (
SupportsFloat,
SupportsIndex,
SupportsInt,
TypeAlias,
TypeVar,
overload,
)
from typing_extensions import Buffer, LiteralString, Self as _Self, TypeAlias
from typing_extensions import Buffer, LiteralString, Self as _Self

_KT = TypeVar("_KT")
_KT_co = TypeVar("_KT_co", covariant=True)
Expand Down
3 changes: 1 addition & 2 deletions stdlib/_typeshed/dbapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# https://www.python.org/dev/peps/pep-0249/

from collections.abc import Mapping, Sequence
from typing import Any, Protocol
from typing_extensions import TypeAlias
from typing import Any, Protocol, TypeAlias

DBAPITypeCode: TypeAlias = Any | None
# Strictly speaking, this should be a Sequence, but the type system does
Expand Down
3 changes: 1 addition & 2 deletions stdlib/_typeshed/wsgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
import sys
from _typeshed import OptExcInfo
from collections.abc import Callable, Iterable, Iterator
from typing import Any, Protocol
from typing_extensions import TypeAlias
from typing import Any, Protocol, TypeAlias

class _Readable(Protocol):
def read(self, size: int = ..., /) -> bytes: ...
Expand Down
4 changes: 2 additions & 2 deletions stdlib/_zstd.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from _typeshed import ReadableBuffer
from collections.abc import Mapping
from compression.zstd import CompressionParameter, DecompressionParameter
from typing import Final, Literal, final
from typing_extensions import Self, TypeAlias
from typing import Final, Literal, TypeAlias, final
from typing_extensions import Self

ZSTD_CLEVEL_DEFAULT: Final = 3
ZSTD_DStreamOutSize: Final = 131072
Expand Down
4 changes: 2 additions & 2 deletions stdlib/abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import _typeshed
import sys
from _typeshed import SupportsWrite
from collections.abc import Callable
from typing import Any, Literal, TypeVar
from typing_extensions import Concatenate, ParamSpec, deprecated
from typing import Any, Literal, ParamSpec, TypeVar
from typing_extensions import Concatenate, deprecated

_T = TypeVar("_T")
_R_co = TypeVar("_R_co", covariant=True)
Expand Down
4 changes: 2 additions & 2 deletions stdlib/aifc.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from types import TracebackType
from typing import IO, Any, Literal, NamedTuple, overload
from typing_extensions import Self, TypeAlias
from typing import IO, Any, Literal, NamedTuple, TypeAlias, overload
from typing_extensions import Self

__all__ = ["Error", "open"]

Expand Down
4 changes: 2 additions & 2 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import sys
from _typeshed import SupportsWrite, sentinel
from collections.abc import Callable, Generator, Iterable, Sequence
from re import Pattern
from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeVar, overload, type_check_only
from typing_extensions import Self, TypeAlias, deprecated
from typing import IO, Any, ClassVar, Final, Generic, NoReturn, Protocol, TypeAlias, TypeVar, overload, type_check_only
from typing_extensions import Self, deprecated

__all__ = [
"ArgumentParser",
Expand Down
4 changes: 2 additions & 2 deletions stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import sys
from _typeshed import ReadableBuffer, SupportsRead, SupportsWrite
from collections.abc import Iterable, MutableSequence
from types import GenericAlias
from typing import Any, ClassVar, Literal, SupportsIndex, TypeVar, overload
from typing_extensions import Self, TypeAlias, deprecated, disjoint_base
from typing import Any, ClassVar, Literal, SupportsIndex, TypeAlias, TypeVar, overload
from typing_extensions import Self, deprecated, disjoint_base

_IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
_FloatTypeCode: TypeAlias = Literal["f", "d"]
Expand Down
3 changes: 1 addition & 2 deletions stdlib/asyncio/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
# Can't NOQA on a specific line: https://github.com/plinss/flake8-noqa/issues/22
import sys
from collections.abc import Awaitable, Coroutine, Generator
from typing import Any, TypeVar
from typing_extensions import TypeAlias
from typing import Any, TypeAlias, TypeVar

# As at runtime, this depends on all submodules defining __all__ accurately.
from .base_events import *
Expand Down
4 changes: 2 additions & 2 deletions stdlib/asyncio/base_events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ from collections.abc import Callable, Iterable, Sequence
from concurrent.futures import Executor, ThreadPoolExecutor
from contextvars import Context
from socket import AddressFamily, AddressInfo, SocketKind, _Address, _RetAddress, socket
from typing import IO, Any, Literal, TypeVar, overload
from typing_extensions import TypeAlias, TypeVarTuple, Unpack
from typing import IO, Any, Literal, TypeAlias, TypeVar, overload
from typing_extensions import TypeVarTuple, Unpack

# Keep asyncio.__all__ updated with any changes to __all__ here
__all__ = ("BaseEventLoop", "Server")
Expand Down
3 changes: 1 addition & 2 deletions stdlib/asyncio/base_subprocess.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import subprocess
from collections import deque
from collections.abc import Callable, Sequence
from typing import IO, Any
from typing_extensions import TypeAlias
from typing import IO, Any, TypeAlias

from . import events, futures, protocols, transports

Expand Down
Loading
Loading