mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-26 21:34:20 +00:00
![]() ## Summary Given `del X`, we'll typically add a `BindingKind::Deletion` to `X` to shadow the current binding. However, if the deletion is inside of a conditional operation, we _won't_, as in: ```python def f(): global X if X > 0: del X ``` We will, however, track it as a reference to the binding. This PR adds the expression context to those resolved references, so that we can detect that the `X` in `global X` was "assigned to". Closes https://github.com/astral-sh/ruff/issues/10397. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |