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 mixin This module contains mixin classes for scoped nodes.
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).
Module utils This module contains utility functions for scoped nodes.

From __init__.py:

Class AsyncFunctionDef Class representing an :class:`ast.FunctionDef` node.
Class ClassDef Class representing an :class:`ast.ClassDef` node.
Class ComprehensionScope Scoping for different types of comprehensions.
Class DictComp Class representing an :class:`ast.DictComp` node.
Class FunctionDef Class representing an :class:`ast.FunctionDef`.
Class GeneratorExp Class representing an :class:`ast.GeneratorExp` node.
Class Lambda Class representing an :class:`ast.Lambda` node.
Class ListComp Class representing an :class:`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 :class:`ast.Module` node.
Class SetComp Class representing an :class:`ast.SetComp` node.
Function builtin_lookup Lookup a name in 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 _is_metaclass(klass, seen=None) -> bool: (source)

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

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: The class that wraps the given node :rtype: ClassDef or None

def builtin_lookup(name: str) -> tuple[nodes.Module, Sequence[nodes.NodeNG]]: (source)

Lookup a name in the builtin module. Return the list of matching statements and the ast for the builtin module