mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
_typeshed: add SupportsLessThan, SupportsLessThanT (#4711)
And use it everywhere. Note there seemed to be a discrepancy between heapq in Python 2 and 3, so I changed that. It should probably be more widely used within heapq, but leaving that out of scope for this PR. Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import SupportsLessThan
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
@@ -59,11 +60,7 @@ def wraps(
|
||||
wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...
|
||||
) -> Callable[[_AnyCallable], _AnyCallable]: ...
|
||||
def total_ordering(cls: Type[_T]) -> Type[_T]: ...
|
||||
|
||||
class _SupportsLessThan(Protocol):
|
||||
def __lt__(self, __other: Any) -> bool: ...
|
||||
|
||||
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], _SupportsLessThan]: ...
|
||||
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], SupportsLessThan]: ...
|
||||
|
||||
class partial(Generic[_T]):
|
||||
func: Callable[..., _T]
|
||||
|
||||
Reference in New Issue
Block a user