class AstroidManager: (source)
Responsible to build astroid from files or modules.
Use the Borg (singleton) pattern.
Method | __init__ |
Undocumented |
Method | ast_from_class |
get astroid for the given class |
Method | ast_from_file |
given a module name, return the astroid object |
Method | ast_from_module |
given an imported module, return the astroid object |
Method | ast_from_module_name |
given a module name, return the astroid object |
Method | ast_from_string |
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_module |
Cache a module if no module with the same name is known yet. |
Method | clear_cache |
Clear the underlying cache. Also bootstraps the builtins module. |
Method | file_from_module_name |
Undocumented |
Method | infer_ast_from_something |
infer astroid for the given class |
Method | register_failed_import_hook |
Registers a hook to resolve imports that cannot be found otherwise. |
Method | visit_transforms |
Visit the transforms and apply them to the given node. |
Method | zip_import_data |
Undocumented |
Class Variable | brain |
Undocumented |
Class Variable | max_inferable_values |
Undocumented |
Class Variable | name |
Undocumented |
Instance Variable | __dict__ |
Undocumented |
Instance Variable | always_load_extensions |
Undocumented |
Instance Variable | astroid_cache |
Undocumented |
Instance Variable | extension_package_whitelist |
Undocumented |
Instance Variable | optimize_ast |
Undocumented |
Property | builtins_module |
Undocumented |
Property | register_transform |
Undocumented |
Property | unregister_transform |
Undocumented |
Method | _build_namespace_module |
Undocumented |
Method | _build_stub_module |
Undocumented |
Method | _can_load_extension |
Undocumented |
Instance Variable | _failed_import_hooks |
Undocumented |
Instance Variable | _mod_file_cache |
Undocumented |
Instance Variable | _transform |
Undocumented |
Parameters | |
module:types.ModuleType | Undocumented |
modname:Optional[ | Undocumented |
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.
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
.
Undocumented
Parameters | |
modname:str | Undocumented |
path:List[ | Undocumented |
Returns | |
nodes.Module | Undocumented |