mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
committed by
Łukasz Langa
parent
8f1875b97b
commit
4ea4bf63f8
@@ -1,18 +1,24 @@
|
||||
from typing import Any, Type, TypeVar
|
||||
from typing import Any, Callable, Type, TypeVar
|
||||
import sys
|
||||
# Stubs for abc.
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_FuncT = TypeVar('_FuncT', bound=Callable[..., Any])
|
||||
|
||||
# Thesee definitions have special processing in type checker.
|
||||
# Thesee definitions have special processing in mypy
|
||||
class ABCMeta(type):
|
||||
if sys.version_info >= (3, 3):
|
||||
def register(cls: "ABCMeta", subclass: Type[_T]) -> Type[_T]: ...
|
||||
else:
|
||||
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
|
||||
abstractmethod = object()
|
||||
abstractproperty = object()
|
||||
|
||||
def abstractmethod(callable: _FuncT) -> _FuncT: ...
|
||||
def abstractproperty(callable: _FuncT) -> _FuncT: ...
|
||||
# These two are deprecated and not supported by mypy
|
||||
def abstractstaticmethod(callable: _FuncT) -> _FuncT: ...
|
||||
def abstractclassmethod(callable: _FuncT) -> _FuncT: ...
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
class ABC(metaclass=ABCMeta):
|
||||
pass
|
||||
def get_cache_token() -> object: ...
|
||||
|
||||
Reference in New Issue
Block a user