1
1
from types import CodeType , TracebackType , FrameType , FunctionType , MethodType , ModuleType
2
- from typing import Any , Dict , Callable , List , NamedTuple , Optional , Sequence , Tuple , Type , Union
2
+ from typing import Any , Dict , Callable , List , NamedTuple , Optional , Sequence , Tuple , Type , Union , AnyStr
3
3
4
4
# Types and members
5
5
class EndOfBlock (Exception ): ...
@@ -10,8 +10,8 @@ class BlockFinder:
10
10
started : bool
11
11
passline : bool
12
12
last : int
13
- def tokeneater (self , type : int , token : str , srow_scol : Tuple [int , int ],
14
- erow_ecol : Tuple [int , int ], line : str ) -> None : ...
13
+ def tokeneater (self , type : int , token : AnyStr , srow_scol : Tuple [int , int ],
14
+ erow_ecol : Tuple [int , int ], line : AnyStr ) -> None : ...
15
15
16
16
CO_GENERATOR : int
17
17
CO_NESTED : int
@@ -32,8 +32,8 @@ def getmembers(
32
32
object : object ,
33
33
predicate : Optional [Callable [[Any ], bool ]] = ...
34
34
) -> List [Tuple [str , Any ]]: ...
35
- def getmoduleinfo (path : str ) -> Optional [ModuleInfo ]: ...
36
- def getmodulename (path : str ) -> Optional [str ]: ...
35
+ def getmoduleinfo (path : Union [ str , unicode ] ) -> Optional [ModuleInfo ]: ...
36
+ def getmodulename (path : AnyStr ) -> Optional [AnyStr ]: ...
37
37
38
38
def ismodule (object : object ) -> bool : ...
39
39
def isclass (object : object ) -> bool : ...
@@ -57,16 +57,16 @@ _SourceObjectType = Union[ModuleType, Type[Any], MethodType, FunctionType, Trace
57
57
58
58
def findsource (object : _SourceObjectType ) -> Tuple [List [str ], int ]: ...
59
59
def getabsfile (object : _SourceObjectType ) -> str : ...
60
- def getblock (lines : Sequence [str ]) -> Sequence [str ]: ...
60
+ def getblock (lines : Sequence [AnyStr ]) -> Sequence [AnyStr ]: ...
61
61
def getdoc (object : object ) -> Optional [str ]: ...
62
62
def getcomments (object : object ) -> Optional [str ]: ...
63
63
def getfile (object : _SourceObjectType ) -> str : ...
64
64
def getmodule (object : object ) -> Optional [ModuleType ]: ...
65
65
def getsourcefile (object : _SourceObjectType ) -> Optional [str ]: ...
66
66
def getsourcelines (object : _SourceObjectType ) -> Tuple [List [str ], int ]: ...
67
67
def getsource (object : _SourceObjectType ) -> str : ...
68
- def cleandoc (doc : str ) -> str : ...
69
- def indentsize (line : str ) -> int : ...
68
+ def cleandoc (doc : AnyStr ) -> AnyStr : ...
69
+ def indentsize (line : Union [ str , unicode ] ) -> int : ...
70
70
71
71
# Classes and functions
72
72
def getclasstree (classes : List [type ], unique : bool = ...) -> List [Union [Tuple [type , Tuple [type , ...]], List [Any ]]]: ...
0 commit comments