mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Preserve original type in total_ordering annotation (#3552)
See https://github.com/microsoft/pyright/issues/443 for reference.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# NOTE: These are incomplete!
|
||||
|
||||
from abc import ABCMeta, abstractmethod
|
||||
from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, TypeVar, overload
|
||||
from typing import Any, Callable, Generic, Dict, Iterable, Optional, Sequence, Tuple, Type, TypeVar, overload
|
||||
|
||||
_AnyCallable = Callable[..., Any]
|
||||
|
||||
@@ -22,7 +22,7 @@ WRAPPER_UPDATES: Sequence[str]
|
||||
def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ...,
|
||||
updated: Sequence[str] = ...) -> _AnyCallable: ...
|
||||
def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ...
|
||||
def total_ordering(cls: type) -> type: ...
|
||||
def total_ordering(cls: Type[_T]) -> Type[_T]: ...
|
||||
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ...
|
||||
|
||||
class partial(Generic[_T]):
|
||||
|
||||
@@ -39,7 +39,7 @@ WRAPPER_UPDATES: Sequence[str]
|
||||
def update_wrapper(wrapper: _AnyCallable, wrapped: _AnyCallable, assigned: Sequence[str] = ...,
|
||||
updated: Sequence[str] = ...) -> _AnyCallable: ...
|
||||
def wraps(wrapped: _AnyCallable, assigned: Sequence[str] = ..., updated: Sequence[str] = ...) -> Callable[[_AnyCallable], _AnyCallable]: ...
|
||||
def total_ordering(cls: type) -> type: ...
|
||||
def total_ordering(cls: Type[_T]) -> Type[_T]: ...
|
||||
def cmp_to_key(mycmp: Callable[[_T, _T], int]) -> Callable[[_T], Any]: ...
|
||||
|
||||
class partial(Generic[_T]):
|
||||
|
||||
Reference in New Issue
Block a user