mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
Copy a better definition of abstractmethod from 3/abc to 2/abc. (#3242)
This commit is contained in:
committed by
Sebastian Rittau
parent
8b28753b64
commit
9488b58fb3
@@ -1,9 +1,11 @@
|
||||
from typing import Any, Dict, Set, Tuple, Type
|
||||
from typing import Any, Callable, Dict, Set, Tuple, Type, TypeVar
|
||||
import _weakrefset
|
||||
|
||||
_FuncT = TypeVar('_FuncT', bound=Callable[..., Any])
|
||||
|
||||
# NOTE: mypy has special processing for ABCMeta and abstractmethod.
|
||||
|
||||
def abstractmethod(funcobj: Any) -> Any: ...
|
||||
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
|
||||
|
||||
class ABCMeta(type):
|
||||
# TODO: FrozenSet
|
||||
|
||||
Reference in New Issue
Block a user