module documentation

this module contains a set of functions to create astroid trees from scratch (build_* functions) or from living object (object_build_* functions)

Class InspectBuilder class for building nodes from living object
Function attach_const_node create a Const node and register it in the locals of the given node with the specified name
Function attach_dummy_node create a dummy node and register it in the locals of the given node with the specified name
Function attach_import_node create a ImportFrom node and register it in the locals of the given node with the specified name
Function build_class create and initialize an astroid ClassDef node
Function build_from_import create and initialize an astroid ImportFrom import statement
Function build_function create and initialize an astroid FunctionDef node
Function build_module create and initialize an astroid Module node
Function object_build_class create astroid for a living class object
Function object_build_datadescriptor create astroid for a living data descriptor object
Function object_build_function create astroid for a living function object
Function object_build_methoddescriptor create astroid for a living method descriptor object
Function register_arguments add given arguments to local
Constant TYPE_ELLIPSIS Undocumented
Constant TYPE_NONE Undocumented
Constant TYPE_NOTIMPLEMENTED Undocumented
Function _add_dunder_class Add a __class__ member to the given func node, if we can determine it.
Function _astroid_bootstrapping astroid bootstrapping the builtins module
Function _attach_local_node Undocumented
Function _base_class_object_build create astroid for a living class object, with a given set of base names (e.g. ancestors)
Function _build_from_function Undocumented
Function _has_underlying_object Undocumented
Function _io_discrepancy Undocumented
Function _safe_has_attribute Undocumented
Function _set_proxied Undocumented
Constant _BUILTINS Undocumented
Constant _CONST_PROXY Undocumented
Constant _CONSTANTS Undocumented
Variable _marker Undocumented
def attach_const_node(node, name, value): (source)

create a Const node and register it in the locals of the given node with the specified name

def attach_dummy_node(node, name, runtime_object=_marker): (source)

create a dummy node and register it in the locals of the given node with the specified name

def attach_import_node(node, modname, membername): (source)

create a ImportFrom node and register it in the locals of the given node with the specified name

def build_class(name, basenames=(), doc=None): (source)

create and initialize an astroid ClassDef node

def build_from_import(fromname, names): (source)

create and initialize an astroid ImportFrom import statement

def build_function(name, args: list[str] | None = None, posonlyargs: list[str] | None = None, defaults=None, doc=None, kwonlyargs: list[str] | None = None) -> nodes.FunctionDef: (source)

create and initialize an astroid FunctionDef node

def build_module(name: str, doc: str | None = None) -> nodes.Module: (source)

create and initialize an astroid Module node

def object_build_class(node, member, localname): (source)

create astroid for a living class object

def object_build_datadescriptor(node, member, name): (source)

create astroid for a living data descriptor object

def object_build_function(node, member, localname): (source)

create astroid for a living function object

def object_build_methoddescriptor(node, member, localname): (source)

create astroid for a living method descriptor object

def register_arguments(func, args=None): (source)

add given arguments to local

args is a list that may contains nested lists (i.e. def func(a, (b, c, d)): ...)

TYPE_ELLIPSIS = (source)

Undocumented

Value
type(...)
TYPE_NONE = (source)

Undocumented

Value
type(None)
TYPE_NOTIMPLEMENTED = (source)

Undocumented

Value
type(NotImplemented)
def _add_dunder_class(func, member): (source)

Add a __class__ member to the given func node, if we can determine it.

def _astroid_bootstrapping(): (source)

astroid bootstrapping the builtins module

def _attach_local_node(parent, node, name): (source)

Undocumented

def _base_class_object_build(node, member, basenames, name=None, localname=None): (source)

create astroid for a living class object, with a given set of base names (e.g. ancestors)

def _build_from_function(node, name, member, module): (source)

Undocumented

def _has_underlying_object(self): (source)

Undocumented

def _io_discrepancy(member): (source)

Undocumented

def _safe_has_attribute(obj, member): (source)

Undocumented

def _set_proxied(const): (source)

Undocumented

_BUILTINS = (source)

Undocumented

Value
vars(builtins)
_CONST_PROXY: dict = (source)

Undocumented

Value
{}
_CONSTANTS = (source)

Undocumented

Value
tuple(node_classes.CONST_CLS)

Undocumented