-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Regression for typing.Annotated when aliased #9092
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Comments
I found a smaller example to reproduce the issue in the pyright playground: Code sample in pyright playground from typing import Annotated
IndirectAnnotated = Annotated
def test(
inp1: Annotated[int, "metadata"], # This is valid
inp2: IndirectAnnotated[int, "metadata"], # "metadata" is not defined (reportUndefinedVariable)
):
pass |
erictraut
added a commit
that referenced
this issue
Sep 26, 2024
… of `Annotated`. This addresses #9092.
Thanks for helping shake out the bugs in the provisional implementation of This will be addressed in the next release. |
erictraut
added
the
addressed in next version
Issue is fixed and will appear in next published version
label
Sep 26, 2024
Thanks a lot, Eric! It's always amazing to see how quickly you react to bug reports here in |
This is addressed in pyright 1.1.383. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
addressed in next version
Issue is fixed and will appear in next published version
bug
Something isn't working
Describe the bug
Pyright
1.1.379 seems to have introduced a different behavior fortyping.Annotated
type forms when:enableExperimentalFeatures: true
is settyping.Annotated
is aliased in another moduleI assume this is due to the provisional support for draft PEP 747 and the
TypeForm
special form.We discovered this because it breaks jaxtyping type annotations, which internally aliases
typing.Annotated
.Code or Screenshots
The file to type check:
indirection.py
pyrightconfig.json
indirection.py
provides a minimal example forjaxtyping
's internal logic.VS Code extension or command-line
All
pyright
versions>=1.1.379
as well aspylance
v2024.9.101 (pre release)
produce the issue:The text was updated successfully, but these errors were encountered: