ruff/crates/ty_python_semantic/resources/mdtest/scopes
Jack O'Connor e9a64e5825
[ty] make del x force local resolution of x in the current scope (#19389)
Fixes https://github.com/astral-sh/ty/issues/769.

**Updated:** The preferred approach here is to keep the SemanticIndex
simple (`del` of any name marks that name "bound" in the current scope)
and to move complexity to type inference (free variable resolution stops
when it finds a binding, unless that binding is declared `nonlocal`). As
part of this change, free variable resolution will now union the types
it finds as it walks in enclosing scopes. This approach is still
incomplete, because it doesn't consider inner scopes or sibling scopes,
but it improves the common case.

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2025-07-18 14:58:32 -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 lint on the global keyword if there's no explicit definition in the global scope 2025-07-15 16:56:54 -07:00
moduletype_attrs.md [ty] support accessing __builtins__ global (#18118) 2025-05-15 22:01:38 +02:00
nonlocal.md [ty] make del x force local resolution of x in the current scope (#19389) 2025-07-18 14:58:32 -07:00
unbound.md