File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 21
21
from astroid .typing import InferenceResult
22
22
23
23
24
- def _build_proxy_class (cls_name , builtins ) :
24
+ def _build_proxy_class (cls_name : str , builtins : nodes . Module ) -> nodes . ClassDef :
25
25
proxy = raw_building .build_class (cls_name )
26
26
proxy .parent = builtins
27
27
return proxy
28
28
29
29
30
- def _function_type (function , builtins ):
30
+ def _function_type (
31
+ function : nodes .Lambda | bases .UnboundMethod , builtins : nodes .Module
32
+ ) -> nodes .ClassDef :
31
33
if isinstance (function , scoped_nodes .Lambda ):
32
34
if function .root ().name == "builtins" :
33
35
cls_name = "builtin_function_or_method"
34
36
else :
35
37
cls_name = "function"
36
38
elif isinstance (function , bases .BoundMethod ):
37
39
cls_name = "method"
38
- elif isinstance ( function , bases . UnboundMethod ) :
40
+ else :
39
41
cls_name = "function"
40
42
return _build_proxy_class (cls_name , builtins )
41
43
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def unregister_transform(self):
86
86
return self ._transform .unregister_transform
87
87
88
88
@property
89
- def builtins_module (self ):
89
+ def builtins_module (self ) -> nodes . Module :
90
90
return self .astroid_cache ["builtins" ]
91
91
92
92
def visit_transforms (self , node ):
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class InferenceErrorInfo(TypedDict):
32
32
class AstroidManagerBrain (TypedDict ):
33
33
"""Dictionary to store relevant information for a AstroidManager class."""
34
34
35
- astroid_cache : dict
35
+ astroid_cache : dict [ str , nodes . Module ]
36
36
_mod_file_cache : dict
37
37
_failed_import_hooks : list
38
38
always_load_extensions : bool
You can’t perform that action at this time.
0 commit comments