Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood
2022-04-15 18:01:00 -07:00
committed by GitHub
parent c0e6dd3f3f
commit 740193a8fc
218 changed files with 760 additions and 625 deletions
+6 -5
View File
@@ -1,12 +1,13 @@
from _typeshed import Self
from lib2to3.pgen2.grammar import Grammar
from typing import Any, Callable, Iterator
from typing_extensions import TypeAlias
_NL = Node | Leaf
_Context = tuple[str, int, int]
_Results = dict[str, _NL]
_RawNode = tuple[int, str, _Context, list[_NL] | None]
_Convert = Callable[[Grammar, _RawNode], Any]
_NL: TypeAlias = Node | Leaf
_Context: TypeAlias = tuple[str, int, int]
_Results: TypeAlias = dict[str, _NL]
_RawNode: TypeAlias = tuple[int, str, _Context, list[_NL] | None]
_Convert: TypeAlias = Callable[[Grammar, _RawNode], Any]
HUGE: int