Skip to content

Commit 4ea4bf6

Browse files
JelleZijlstraambv
authored andcommitted
add some missing names to abc.pyi (#1199)
Fixes #304
1 parent 8f1875b commit 4ea4bf6

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

stdlib/3/abc.pyi

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1-
from typing import Any, Type, TypeVar
1+
from typing import Any, Callable, Type, TypeVar
22
import sys
33
# Stubs for abc.
44

55
_T = TypeVar('_T')
6+
_FuncT = TypeVar('_FuncT', bound=Callable[..., Any])
67

7-
# Thesee definitions have special processing in type checker.
8+
# Thesee definitions have special processing in mypy
89
class ABCMeta(type):
910
if sys.version_info >= (3, 3):
1011
def register(cls: "ABCMeta", subclass: Type[_T]) -> Type[_T]: ...
1112
else:
1213
def register(cls: "ABCMeta", subclass: Type[Any]) -> None: ...
13-
abstractmethod = object()
14-
abstractproperty = object()
14+
15+
def abstractmethod(callable: _FuncT) -> _FuncT: ...
16+
def abstractproperty(callable: _FuncT) -> _FuncT: ...
17+
# These two are deprecated and not supported by mypy
18+
def abstractstaticmethod(callable: _FuncT) -> _FuncT: ...
19+
def abstractclassmethod(callable: _FuncT) -> _FuncT: ...
1520

1621
if sys.version_info >= (3, 4):
1722
class ABC(metaclass=ABCMeta):
1823
pass
24+
def get_cache_token() -> object: ...

0 commit comments

Comments
 (0)