mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Improve UserList comparison methods (#6471)
These functions will fail at runtime if `other` is not either a `list` or a `UserList`. The elements within `other` must also be of the same type as the elements within `self`, or the comparison will fail.
This commit is contained in:
@@ -51,10 +51,10 @@ class UserDict(MutableMapping[_KT, _VT]):
|
||||
class UserList(MutableSequence[_T]):
|
||||
data: list[_T]
|
||||
def __init__(self, initlist: Iterable[_T] | None = ...) -> None: ...
|
||||
def __lt__(self, other: object) -> bool: ...
|
||||
def __le__(self, other: object) -> bool: ...
|
||||
def __gt__(self, other: object) -> bool: ...
|
||||
def __ge__(self, other: object) -> bool: ...
|
||||
def __lt__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __le__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __gt__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __ge__(self, other: list[_T] | UserList[_T]) -> bool: ...
|
||||
def __contains__(self, item: object) -> bool: ...
|
||||
def __len__(self) -> int: ...
|
||||
@overload
|
||||
|
||||
Reference in New Issue
Block a user