mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-02-01 23:55:26 +08:00
Remove or move several TypeAlias declarations (#8444)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
from collections.abc import Callable
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from lib2to3.pytree import _RawNode
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
# This is imported in several lib2to3/pgen2 submodules
|
||||
_Convert: TypeAlias = Callable[[Grammar, _RawNode], Any]
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import Iterable
|
||||
from lib2to3.pgen2 import _Convert
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from lib2to3.pytree import _NL, _Convert
|
||||
from lib2to3.pytree import _NL
|
||||
from logging import Logger
|
||||
from typing import IO, Any
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from collections.abc import Sequence
|
||||
from lib2to3.pgen2 import _Convert
|
||||
from lib2to3.pgen2.grammar import _DFAS, Grammar
|
||||
from lib2to3.pytree import _NL, _Convert, _RawNode
|
||||
from lib2to3.pytree import _NL, _RawNode
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from _typeshed import Self
|
||||
from collections.abc import Callable, Iterator
|
||||
from collections.abc import Iterator
|
||||
from lib2to3.pgen2.grammar import Grammar
|
||||
from typing import Any
|
||||
from typing_extensions import TypeAlias
|
||||
@@ -8,9 +8,6 @@ _NL: TypeAlias = Node | Leaf
|
||||
_Context: TypeAlias = tuple[str, int, int]
|
||||
_Results: TypeAlias = dict[str, _NL]
|
||||
_RawNode: TypeAlias = tuple[int, str, _Context, list[_NL] | None]
|
||||
# This alias isn't used in this file,
|
||||
# but is imported in other lib2to3 submodules
|
||||
_Convert: TypeAlias = Callable[[Grammar, _RawNode], Any]
|
||||
|
||||
HUGE: int
|
||||
|
||||
|
||||
@@ -14,7 +14,6 @@ _SqliteData: TypeAlias = str | ReadableBuffer | int | float | None
|
||||
_AdaptedInputData: TypeAlias = _SqliteData | Any
|
||||
# The Mapping must really be a dict, but making it invariant is too annoying.
|
||||
_Parameters: TypeAlias = SupportsLenAndGetItem[_AdaptedInputData] | Mapping[str, _AdaptedInputData]
|
||||
_SqliteOutputData: TypeAlias = str | bytes | int | float | None
|
||||
_Adapter: TypeAlias = Callable[[_T], _SqliteData]
|
||||
_Converter: TypeAlias = Callable[[bytes], Any]
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from typing_extensions import Literal, TypeAlias, final
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
_OptExcInfo: TypeAlias = OptExcInfo # TODO: obsolete, remove fall 2022 or later
|
||||
_OptExcInfo: TypeAlias = OptExcInfo # noqa: Y047 # TODO: obsolete, remove fall 2022 or later
|
||||
|
||||
# Intentionally omits one deprecated and one optional method of `importlib.abc.MetaPathFinder`
|
||||
class _MetaPathFinder(Protocol):
|
||||
|
||||
Reference in New Issue
Block a user