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,7 +3,7 @@ from _typeshed import Self, StrOrBytesPath
from cProfile import Profile as _cProfile
from profile import Profile
from typing import IO, Any, Iterable, overload
from typing_extensions import Literal
from typing_extensions import Literal, TypeAlias
if sys.version_info >= (3, 9):
__all__ = ["Stats", "SortKey", "FunctionProfile", "StatsProfile"]
@@ -12,7 +12,7 @@ elif sys.version_info >= (3, 7):
else:
__all__ = ["Stats"]
_Selector = str | float | int
_Selector: TypeAlias = str | float | int
if sys.version_info >= (3, 7):
from enum import Enum
@@ -45,7 +45,7 @@ if sys.version_info >= (3, 9):
total_tt: float
func_profiles: dict[str, FunctionProfile]
_SortArgDict = dict[str, tuple[tuple[tuple[int, int], ...], str]]
_SortArgDict: TypeAlias = dict[str, tuple[tuple[tuple[int, int], ...], str]]
class Stats:
sort_arg_dict_default: _SortArgDict