package documentation

This module contains all classes that are considered a "scoped" node and anything related. A scope node is a node that opens a new local scope in the language definition: Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent).

Module scoped_nodes This module contains the classes for "scoped" node, i.e. which are opening a new local scope in the language definition : Module, ClassDef, FunctionDef (and Lambda, GeneratorExp, DictComp and SetComp to some extent).

From __init__.py:

Class AsyncFunctionDef Class representing an ast.FunctionDef node.
Class ClassDef Class representing an ast.ClassDef node.
Class ComprehensionScope Scoping for different types of comprehensions.
Class DictComp Class representing an ast.DictComp node.
Class FunctionDef Class representing an ast.FunctionDef.
Class GeneratorExp Class representing an ast.GeneratorExp node.
Class Lambda Class representing an ast.Lambda node.
Class ListComp Class representing an ast.ListComp node.
Class LocalsDictNodeNG this class provides locals handling common to Module, FunctionDef and ClassDef nodes, including a dict like interface for direct access to locals information
Class Module Class representing an ast.Module node.
Class SetComp Class representing an ast.SetComp node.
Function builtin_lookup lookup a name into the builtin module return the list of matching statements and the astroid for the builtin module
Function function_to_method Undocumented
Function get_wrapping_class Get the class that wraps the given node.
Function _is_metaclass Return if the given class can be used as a metaclass.
def builtin_lookup(name): (source)

lookup a name into the builtin module return the list of matching statements and the astroid for the builtin module

def function_to_method(n, klass): (source)

Undocumented

def get_wrapping_class(node): (source)

Get the class that wraps the given node.

We consider that a class wraps a node if the class is a parent for the said node.

Returns
ClassDef or NoneThe class that wraps the given node
def _is_metaclass(klass, seen=None): (source)

Return if the given class can be used as a metaclass.