class AstroidManager: (source)
Responsible to build astroid from files or modules. Use the Borg (singleton) pattern.
Method | __init__ |
Undocumented |
Method | ast |
Get astroid for the given class. |
Method | ast |
Given a module name, return the astroid object. |
Method | ast |
Given an imported module, return the astroid object. |
Method | ast |
Given a module name, return the astroid object. |
Method | ast |
Given some source code as a string, return its corresponding astroid object. |
Method | bootstrap |
Bootstrap the required AST modules needed for the manager to work. |
Method | cache |
Cache a module if no module with the same name is known yet. |
Method | clear |
Clear the underlying caches, bootstrap the builtins module and re-register transforms. |
Method | file |
Undocumented |
Method | infer |
Infer astroid for the given class. |
Method | register |
Registers a hook to resolve imports that cannot be found otherwise. |
Method | visit |
Visit the transforms and apply them to the given *node*. |
Method | zip |
Undocumented |
Class Variable | brain |
Undocumented |
Class Variable | max |
Undocumented |
Class Variable | name |
Undocumented |
Instance Variable | always |
Undocumented |
Instance Variable | astroid |
Undocumented |
Instance Variable | extension |
Undocumented |
Instance Variable | optimize |
Undocumented |
Property | builtins |
Undocumented |
Property | register |
Undocumented |
Property | unregister |
Undocumented |
Method | _build |
Undocumented |
Method | _build |
Undocumented |
Method | _can |
Undocumented |
Instance Variable | _failed |
Undocumented |
Instance Variable | _mod |
Undocumented |
Instance Variable | _transform |
Undocumented |
str
, modname: str|None
= None, fallback: bool
= True, source: bool
= False) -> nodes.Module
:
(source)
¶
Given a module name, return the astroid object.
types.ModuleType
, modname: str|None
= None) -> nodes.Module
:
(source)
¶
Given an imported module, return the astroid object.
str|None
, context_file: str|None
= None, use_cache: bool
= True) -> nodes.Module
:
(source)
¶
Given a module name, return the astroid object.
str
, modname: str
= '', filepath: str|None
= None) -> nodes.Module
:
(source)
¶
Given some source code as a string, return its corresponding astroid object.
Bootstrap the required AST modules needed for the manager to work. The bootstrap usually involves building the AST for the builtins module, which is required by the rest of astroid to work correctly.
object
, context: InferenceContext|None
= None) -> Iterator[ InferenceResult]
:
(source)
¶
Infer astroid for the given class.
Registers a hook to resolve imports that cannot be found otherwise. `hook` must be a function that accepts a single argument `modname` which contains the name of the module or package that could not be imported. If `hook` can resolve the import, must return a node of type `astroid.Module`, otherwise, it must raise `AstroidBuildingError`.