mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
stdlib: Add several missing comparison methods (#7202)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from _tracemalloc import *
|
||||
from typing import Optional, Sequence, Union, overload
|
||||
from typing import Any, Optional, Sequence, Union, overload
|
||||
from typing_extensions import SupportsIndex
|
||||
|
||||
def get_object_traceback(obj: object) -> Traceback | None: ...
|
||||
@@ -41,6 +41,15 @@ class Frame:
|
||||
filename: str
|
||||
lineno: int
|
||||
def __init__(self, frame: _FrameTupleT) -> None: ...
|
||||
def __lt__(self, other: Frame) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __gt__(self, other: Frame) -> bool: ...
|
||||
def __ge__(self, other: Frame) -> bool: ...
|
||||
def __le__(self, other: Frame) -> bool: ...
|
||||
else:
|
||||
def __gt__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
|
||||
def __ge__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
|
||||
def __le__(self, other: Frame, NotImplemented: Any = ...) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
_TraceTupleT = Union[tuple[int, int, Sequence[_FrameTupleT], Optional[int]], tuple[int, int, Sequence[_FrameTupleT]]]
|
||||
@@ -69,6 +78,15 @@ class Traceback(Sequence[Frame]):
|
||||
@overload
|
||||
def __getitem__(self, s: slice) -> Sequence[Frame]: ...
|
||||
def __len__(self) -> int: ...
|
||||
def __lt__(self, other: Traceback) -> bool: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def __gt__(self, other: Traceback) -> bool: ...
|
||||
def __ge__(self, other: Traceback) -> bool: ...
|
||||
def __le__(self, other: Traceback) -> bool: ...
|
||||
else:
|
||||
def __gt__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
|
||||
def __ge__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
|
||||
def __le__(self, other: Traceback, NotImplemented: Any = ...) -> bool: ...
|
||||
|
||||
class Snapshot:
|
||||
def __init__(self, traces: Sequence[_TraceTupleT], traceback_limit: int) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user