class documentation
class AstroidBuilder(raw_building.InspectBuilder): (source)
Constructor: AstroidBuilder(manager, apply_transforms)
Class for building an astroid tree from source code or from a live module.
The param manager specifies the manager class which should be used. If no manager is given, then the default one will be used. The param apply_transforms determines if the transforms should be applied after the tree was built from source or from a live object, by default being True.
| Method | __init__ |
Undocumented |
| Method | add |
Store imported names to the locals |
| Method | delayed |
Visit a AssAttr node |
| Method | file |
Build astroid from a source code file (i.e. from an ast) |
| Method | module |
Build an astroid from a living module instance. |
| Method | string |
Build astroid from source code string. |
| Method | _data |
Build tree node from data and add some information |
| Method | _post |
Handles encoding and delayed nodes after a module has been built |
| Instance Variable | _apply |
Undocumented |
Inherited from InspectBuilder:
| Method | imported |
verify this is not an imported class or handle it |
| Method | inspect |
build astroid from a living module (i.e. using inspect) this is used when there is no python source code available (either because it's a built-in module or because the .py is not available) |
| Method | object |
recursive method which create a partial ast from real objects (only function, class, and method are handled) |
| Instance Variable | _done |
Undocumented |
| Instance Variable | _manager |
Undocumented |
| Instance Variable | _module |
Undocumented |
Build astroid from a source code file (i.e. from an ast)
path is expected to be a python source file
def module_build(self, module:
types.ModuleType, modname: str | None = None) -> nodes.Module:
(source)
¶
Build an astroid from a living module instance.