Skip to main content

Module bindings

Module bindings 

Source

Structs§

PythonClassReferenceScope
Binding events in an executing class namespace at one reference. Only a proved static superclass path precedes that class statement’s name binding. Lazy type-parameter expressions and other header contexts keep that event. Other events retain the existing whole-scope conservative interpretation.
PythonDirectScopeBinding
PythonLexicalScopeBindings
Completed function binding facts without borrowed tree-sitter nodes. Retain these only under the identity of the exact source that produced them.
PythonLexicalScopeInventory
Function-scope Python bindings discovered from tree-sitter structure.

Enums§

PythonDirectScopeBindingKind
PythonLexicalNameResolution

Functions§

python_binding_targets_bounded
Collect the binders in one already-selected assignment or loop target. Attribute/subscript operands remain reads, and exhaustion stays explicit. Callers supply the grammar field rather than reconstructing target syntax.
python_comprehension_binds_name_at
Whether reference reads a target introduced by an enclosing comprehension.
python_comprehension_binds_name_at_bounded
The same scope proof under the caller’s work/cancellation ledger. An interrupted walk must not be interpreted as an unbound name.
python_direct_scope_bindings_bounded
Return the bindings introduced directly by node.
python_executable_scope_children
Iterate executable-scope children, skipping nested callable and class bodies.
python_global_binding_is_untouched_bounded
Prove that a selected global route has no known binding event in its executing enclosing scopes. Outer locals are unrelated to this namespace; an outer scope declaring the same global can still replace its identity. Class namespaces are not captured: only explicit global events are read. The caller has already selected global_scope by lexical precedence.
python_is_type_parameter_binder
Whether this identifier is the binder (rather than a bound/constraint use) of one structured PEP 695 type parameter.
python_module_or_class_scope_binds_name_bounded
Whether a module or class execution scope binds target_name anywhere in its direct scope. Nested callable and class bodies are separate scopes, but their headers still execute in this scope. A wildcard import keeps the name’s runtime identity open even when it does not expose a static binder.
python_name_resolution_at
Resolve name through the nearest enclosing function scope. This is the structured fallback for references inside nested functions that do not have their own indexed CodeUnit scope snapshot.
python_type_parameter_binds_name_at
Whether reference reads a PEP 695 type parameter declared by its enclosing class, function, or type-alias definition.
python_type_parameter_binds_name_at_bounded
The shared type-parameter proof under the caller’s live work budget. An interrupted ancestor, binder, or directive walk supplies no answer.
python_unambiguous_module_binding_bounded
The kind of the module scope’s one binding of target_name.
python_unambiguous_module_binding_node_bounded
The module scope’s unique binding event, after the bounded proof completes.
python_unambiguous_module_class_binding_bounded