-
-
Notifications
You must be signed in to change notification settings - Fork 507
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
Add support for TypeAlias
#1969
Comments
I agree, this should probably be easy! |
Aside: I've since spotted that in Python 3.12, the |
Stepping through this the important bit is, I think, where we end up in I'm not really sure what the idea change is though. We do need to run at least some of the I think one option here is to:
The alternative I can think of here is perhaps more general, though potentially has other impacts. In theory I think we could opt to always evaluate the assigned value in the case where the type annotation doesn't resolve to anything useful. Exactly what "not useful" means here is debatable, but I'm mostly thinking of:
These two things aren't exclusive either -- we could have both if we wanted. I'm leaning more towards the first option -- it feels like a better solution to the specific problem here. Would be good to get your thoughts and perhaps some pointers towards intercepting the processing of |
Sorry for the large delay, I kind of forgot about this tab and got sick after. I'm generally fine with both options. I think both options are better then the status quo. The reason why I don't think Option 2 is terrible is that Jedi has never been about absolute precision like Mypy for example, we have always tried to give the user as much as possible, even with sometimes questionable heuristics. This might be another "questionable" heuristic, that is however not completely wrong either when it comes to autocompletion. |
Currently types annotated as being
TypeAlias
end up not having any useful members. Probably the simplest fix is to ignore the annotation when it'styping.TypeAlias
since manually removing the annotation does normally bring completions back.The text was updated successfully, but these errors were encountered: