class documentation

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_from_names_to_locals Store imported names to the locals.
Method delayed_assattr Visit a AssAttr node.
Method file_build Build astroid from a source code file (i.e. from an ast).
Method module_build Build an astroid from a living module instance.
Method string_build Build astroid from source code string.
Method _data_build Build tree node from data and add some informations.
Method _post_build Handles encoding and delayed nodes after a module has been built.
Instance Variable _apply_transforms Undocumented

Inherited from InspectBuilder:

Method imported_member verify this is not an imported class or handle it
Method inspect_build 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_build 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
def __init__(self, manager: AstroidManager|None = None, apply_transforms: bool = True): (source)
def add_from_names_to_locals(self, node: nodes.ImportFrom): (source)

Store imported names to the locals. Resort the locals if coming from a delayed node

def delayed_assattr(self, node: nodes.AssignAttr): (source)

Visit a AssAttr node. This adds name to locals and handle members definition.

def file_build(self, path: str, modname: str|None = None) -> nodes.Module: (source)

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.

def string_build(self, data: str, modname: str = '', path: str|None = None) -> nodes.Module: (source)

Build astroid from source code string.

def _data_build(self, data: str, modname: str, path: str|None) -> tuple[nodes.Module, rebuilder.TreeRebuilder]: (source)

Build tree node from data and add some informations.

def _post_build(self, module: nodes.Module, builder: rebuilder.TreeRebuilder, encoding: str) -> nodes.Module: (source)

Handles encoding and delayed nodes after a module has been built.

_apply_transforms = (source)

Undocumented