Skip to main content

python_comprehension_binds_name_at

Function python_comprehension_binds_name_at 

Source
pub fn python_comprehension_binds_name_at(
    name: &str,
    reference: Node<'_>,
    source: &str,
) -> bool
Expand description

Whether reference reads a target introduced by an enclosing comprehension.

Comprehensions create an implicit scope even at module level. The element expression is textually before its for clauses but evaluates after their binders, while a clause’s own iterable evaluates before that clause binds its target. This structured walk models that ordering without source-text parsing.