mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Use TypeAlias where possible for type aliases (#7630)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import sys
|
||||
from _tracemalloc import *
|
||||
from typing import Any, Sequence, Union, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
from typing_extensions import SupportsIndex, TypeAlias
|
||||
|
||||
def get_object_traceback(obj: object) -> Traceback | None: ...
|
||||
def take_snapshot() -> Snapshot: ...
|
||||
@@ -41,7 +41,7 @@ class StatisticDiff:
|
||||
def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
|
||||
_FrameTupleT = tuple[str, int]
|
||||
_FrameTupleT: TypeAlias = tuple[str, int]
|
||||
|
||||
class Frame:
|
||||
@property
|
||||
@@ -61,9 +61,9 @@ class Frame:
|
||||
def __le__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
_TraceTupleT = Union[tuple[int, int, Sequence[_FrameTupleT], int | None], tuple[int, int, Sequence[_FrameTupleT]]]
|
||||
_TraceTupleT: TypeAlias = Union[tuple[int, int, Sequence[_FrameTupleT], int | None], tuple[int, int, Sequence[_FrameTupleT]]]
|
||||
else:
|
||||
_TraceTupleT = tuple[int, int, Sequence[_FrameTupleT]]
|
||||
_TraceTupleT: TypeAlias = tuple[int, int, Sequence[_FrameTupleT]]
|
||||
|
||||
class Trace:
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user