-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Inference of typing.Annotated #1747
Comments
I'm pretty sure this is not handled yet. Want to try to fix it? I'm happy to assist. The right place to work on this is definitely |
@davidhalter Any hints on where to start in I think the intended behavior would be to just return the type of the first parameter to the jedi/jedi/inference/gradual/typing.py Lines 116 to 118 in dcea842
|
Oh yeah, good find! It's pretty much that I guess. Feel free to create a PR for it :) |
Hey!
I've got a project where I'm looking at using the
Annotated
type annotation which was new in Python 3.9 (and backported through typing_extensions).I'd expect Jedi to take the naive route and go with "simply treat the type as
T
". However it's not something which Jedi handles at present as I've confirmed with a fresh clone of the repo today.How might I go about adding support for this in Jedi? I'm new to this codebase so some pointers would be appreciated.
Or is this even a Jedi thing in the first place? is something else missing a definition about
Annotated
?I was looking at how to implement it and ended up starting with a basic test which fails as expected. Does this look right as a starting point?
The first and third tests there fail as expected with this sort of message:
The text was updated successfully, but these errors were encountered: