ruff/crates/ty_python_semantic/resources/mdtest/scopes
Jack O'Connor a357a68fc9 distinguish references from definitions in infer_nonlocal
The initial implementation of `infer_nonlocal` landed in
https://github.com/astral-sh/ruff/pull/19112 fails to report an error
for this example:

```py
x = 1
def f():
    # This is only a usage of `x`, not a definition. It shouldn't be
    # enough to make the `nonlocal` statement below allowed.
    print(x)
    def g():
        nonlocal x
```

Fix this by continuing to walk enclosing scopes when the place we've
found isn't bound, declared, or `nonlocal`.
2025-07-15 07:55:40 -07:00
..
builtin.md [ty] Infer nonlocal types as unions of all reachable bindings (#18750) 2025-06-26 12:24:40 +02:00
eager.md [ty] Infer nonlocal types as unions of all reachable bindings (#18750) 2025-06-26 12:24:40 +02:00
global-constants.md [ty] Add support for global __debug__ constant (#18540) 2025-06-10 06:48:59 +00:00
global.md [ty] add support for nonlocal statements 2025-07-11 09:44:54 -07:00
moduletype_attrs.md [ty] support accessing __builtins__ global (#18118) 2025-05-15 22:01:38 +02:00
nonlocal.md distinguish references from definitions in infer_nonlocal 2025-07-15 07:55:40 -07:00
unbound.md