File tree 1 file changed +10
-4
lines changed 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change 1
- from typing import Any , Type , TypeVar
1
+ from typing import Any , Callable , Type , TypeVar
2
2
import sys
3
3
# Stubs for abc.
4
4
5
5
_T = TypeVar ('_T' )
6
+ _FuncT = TypeVar ('_FuncT' , bound = Callable [..., Any ])
6
7
7
- # Thesee definitions have special processing in type checker.
8
+ # Thesee definitions have special processing in mypy
8
9
class ABCMeta (type ):
9
10
if sys .version_info >= (3 , 3 ):
10
11
def register (cls : "ABCMeta" , subclass : Type [_T ]) -> Type [_T ]: ...
11
12
else :
12
13
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 : ...
15
20
16
21
if sys .version_info >= (3 , 4 ):
17
22
class ABC (metaclass = ABCMeta ):
18
23
pass
24
+ def get_cache_token () -> object : ...
You can’t perform that action at this time.
0 commit comments