You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test.py:8:10: F821 Undefined name `qux`
Found 1 error.
The minimal reproducable example looks a little bit weird, but I came across this when writing a pydantic validator on some (IMO) reasonable pydantic code. A more sensible example can be seen below.
## Summary
Given:
```python
baz: Annotated[
str,
[qux for qux in foo],
]
```
We treat `baz` as `BindingKind::Annotation`, to ensure that references
to `baz` are marked as unbound. However, we were _also_ treating `qux`
as `BindingKind::Annotation`, which meant that the load in the
comprehension _also_ errored.
Closes#7879.
## Summary
Given:
```python
baz: Annotated[
str,
[qux for qux in foo],
]
```
We treat `baz` as `BindingKind::Annotation`, to ensure that references
to `baz` are marked as unbound. However, we were _also_ treating `qux`
as `BindingKind::Annotation`, which meant that the load in the
comprehension _also_ errored.
Closes#7879.
Using Ruff
0.0.292
on the following code snippetThe following error is raised:
The minimal reproducable example looks a little bit weird, but I came across this when writing a pydantic validator on some (IMO) reasonable pydantic code. A more sensible example can be seen below.
The text was updated successfully, but these errors were encountered: