Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow bindings to be created and referenced within annotations #7885

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

charliermarsh
Copy link
Member

Summary

Given:

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.

@charliermarsh charliermarsh added the bug Something isn't working label Oct 10, 2023
@charliermarsh charliermarsh enabled auto-merge (squash) October 10, 2023 03:42
@charliermarsh charliermarsh merged commit a3e8e77 into main Oct 10, 2023
15 checks passed
@charliermarsh charliermarsh deleted the charlie/annotate branch October 10, 2023 03:51
@github-actions
Copy link
Contributor

PR Check Results

Ecosystem

✅ ecosystem check detected no changes.

konstin pushed a commit that referenced this pull request Oct 11, 2023
## 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect F821 raised for list comprehension in Annotated
1 participant