class documentation

class AstroidBuilder(raw_building.InspectBuilder): (source)

View In Hierarchy

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 information
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=None, apply_transforms=True): (source)
def add_from_names_to_locals(self, node): (source)

Store imported names to the locals

Resort the locals if coming from a delayed node

def delayed_assattr(self, node): (source)

Visit a AssAttr node

This adds name to locals and handle members definition.

def file_build(self, path, modname=None): (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, modname=None): (source)
Build an astroid from a living module instance.
Parameters
module:types.ModuleTypeUndocumented
modname:Optional[str]Undocumented
Returns
nodes.ModuleUndocumented
def string_build(self, data, modname='', path=None): (source)
Build astroid from source code string.
def _data_build(self, data, modname, path): (source)
Build tree node from data and add some information
def _post_build(self, module, encoding): (source)
Handles encoding and delayed nodes after a module has been built
_apply_transforms = (source)

Undocumented