mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Big diff: Use new "|" union syntax (#5872)
This commit is contained in:
@@ -3,7 +3,7 @@ from typing import List, Optional, Sequence, Tuple, Union, overload
|
||||
|
||||
from _tracemalloc import *
|
||||
|
||||
def get_object_traceback(obj: object) -> Optional[Traceback]: ...
|
||||
def get_object_traceback(obj: object) -> Traceback | None: ...
|
||||
def take_snapshot() -> Snapshot: ...
|
||||
|
||||
class DomainFilter:
|
||||
@@ -12,18 +12,13 @@ class DomainFilter:
|
||||
def __init__(self, inclusive: bool, domain: int) -> None: ...
|
||||
|
||||
class Filter:
|
||||
domain: Optional[int]
|
||||
domain: int | None
|
||||
inclusive: bool
|
||||
lineno: Optional[int]
|
||||
lineno: int | None
|
||||
filename_pattern: str
|
||||
all_frames: bool
|
||||
def __init__(
|
||||
self,
|
||||
inclusive: bool,
|
||||
filename_pattern: str,
|
||||
lineno: Optional[int] = ...,
|
||||
all_frames: bool = ...,
|
||||
domain: Optional[int] = ...,
|
||||
self, inclusive: bool, filename_pattern: str, lineno: int | None = ..., all_frames: bool = ..., domain: int | None = ...
|
||||
) -> None: ...
|
||||
|
||||
class Statistic:
|
||||
@@ -60,14 +55,14 @@ class Trace:
|
||||
|
||||
class Traceback(Sequence[Frame]):
|
||||
if sys.version_info >= (3, 9):
|
||||
total_nframe: Optional[int]
|
||||
def __init__(self, frames: Sequence[_FrameTupleT], total_nframe: Optional[int] = ...) -> None: ...
|
||||
total_nframe: int | None
|
||||
def __init__(self, frames: Sequence[_FrameTupleT], total_nframe: int | None = ...) -> None: ...
|
||||
else:
|
||||
def __init__(self, frames: Sequence[_FrameTupleT]) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def format(self, limit: Optional[int] = ..., most_recent_first: bool = ...) -> List[str]: ...
|
||||
def format(self, limit: int | None = ..., most_recent_first: bool = ...) -> List[str]: ...
|
||||
else:
|
||||
def format(self, limit: Optional[int] = ...) -> List[str]: ...
|
||||
def format(self, limit: int | None = ...) -> List[str]: ...
|
||||
@overload
|
||||
def __getitem__(self, i: int) -> Frame: ...
|
||||
@overload
|
||||
@@ -78,7 +73,7 @@ class Snapshot:
|
||||
def __init__(self, traces: Sequence[_TraceTupleT], traceback_limit: int) -> None: ...
|
||||
def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ...
|
||||
def dump(self, filename: str) -> None: ...
|
||||
def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ...
|
||||
def filter_traces(self, filters: Sequence[DomainFilter | Filter]) -> Snapshot: ...
|
||||
@staticmethod
|
||||
def load(filename: str) -> Snapshot: ...
|
||||
def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ...
|
||||
|
||||
Reference in New Issue
Block a user