Use TypeAlias where possible for type aliases (#7630)

This commit is contained in:
Alex Waygood
2022-04-16 02:01:00 +01:00
committed by GitHub
parent c0e6dd3f3f
commit 740193a8fc
218 changed files with 760 additions and 625 deletions

View File

@@ -3,10 +3,11 @@ import sys
from _typeshed import Self
from types import TracebackType
from typing import Any, Container, NamedTuple, Sequence, Union, overload
from typing_extensions import TypeAlias
_Decimal = Decimal | int
_DecimalNew = Union[Decimal, float, str, tuple[int, Sequence[int], int]]
_ComparableNum = Decimal | float | numbers.Rational
_Decimal: TypeAlias = Decimal | int
_DecimalNew: TypeAlias = Union[Decimal, float, str, tuple[int, Sequence[int], int]]
_ComparableNum: TypeAlias = Decimal | float | numbers.Rational
__libmpdec_version__: str
@@ -159,7 +160,7 @@ class _ContextManager:
def __enter__(self) -> Context: ...
def __exit__(self, t: type[BaseException] | None, v: BaseException | None, tb: TracebackType | None) -> None: ...
_TrapType = type[DecimalException]
_TrapType: TypeAlias = type[DecimalException]
class Context:
prec: int