stdlib: Add several missing comparison methods (#7202)

This commit is contained in:
Alex Waygood
2022-02-14 19:09:52 +00:00
committed by GitHub
parent f3ad0179f8
commit 66a229b709
5 changed files with 37 additions and 1 deletions

View File

@@ -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: ...