Improved Overload Resolution #4148
3ok
started this conversation in
Enhancement
Replies: 1 comment 1 reply
-
This is related to this work item. We've implemented the necessary support in the type evaluator to determine which overloads are applicable for a call expression. The hover text (tooltip) now applies this filtering, but the signature help (the functionality you're referring to above) has not yet been updated to apply this filtering. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi 👋
I have been using Pylance as my language server for Python development, and I have noticed an issue with overload resolution. Specifically, when I define multiple overloads for a function, Pylance does not always suggest the correct overload based on the arguments provided.
For example, consider the following code:
When I start typing a call to the
foo
function with the argument"human"
, and VSCode/Pylance suggests overloads, it always shows the first overload (the"bunny"
🐰 one) , even though it is not the most relevant one in this case.I would have expected that either the second or third overload would be shown instead of the first one that is no longer relevant. Automatically going to
2 / 3
or3 / 3
(or removing the first overload from being shown, i.e. have something liken / 2
) would be more user-friendly IMO, especially in cases where there is a lot of overloads.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions