mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user