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 2121from astroid .typing import InferenceResult
2222
2323
24- def _build_proxy_class (cls_name , builtins ) :
24+ def _build_proxy_class (cls_name : str , builtins : nodes . Module ) -> nodes . ClassDef :
2525 proxy = raw_building .build_class (cls_name )
2626 proxy .parent = builtins
2727 return proxy
2828
2929
30- def _function_type (function , builtins ):
30+ def _function_type (
31+ function : nodes .Lambda | bases .UnboundMethod , builtins : nodes .Module
32+ ) -> nodes .ClassDef :
3133 if isinstance (function , scoped_nodes .Lambda ):
3234 if function .root ().name == "builtins" :
3335 cls_name = "builtin_function_or_method"
3436 else :
3537 cls_name = "function"
3638 elif isinstance (function , bases .BoundMethod ):
3739 cls_name = "method"
38- elif isinstance ( function , bases . UnboundMethod ) :
40+ else :
3941 cls_name = "function"
4042 return _build_proxy_class (cls_name , builtins )
4143
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ def unregister_transform(self):
8686 return self ._transform .unregister_transform
8787
8888 @property
89- def builtins_module (self ):
89+ def builtins_module (self ) -> nodes . Module :
9090 return self .astroid_cache ["builtins" ]
9191
9292 def visit_transforms (self , node ):
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class InferenceErrorInfo(TypedDict):
3232class AstroidManagerBrain (TypedDict ):
3333 """Dictionary to store relevant information for a AstroidManager class."""
3434
35- astroid_cache : dict
35+ astroid_cache : dict [ str , nodes . Module ]
3636 _mod_file_cache : dict
3737 _failed_import_hooks : list
3838 always_load_extensions : bool
You can’t perform that action at this time.
0 commit comments