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

Pylance confused with @dispatch functions #51

Closed
VolodyaCO opened this issue Jul 23, 2022 · 10 comments
Closed

Pylance confused with @dispatch functions #51

VolodyaCO opened this issue Jul 23, 2022 · 10 comments

Comments

@VolodyaCO
Copy link

If I use pylance to type check functions in Python, all multiple-dispatched functions are shown as

Function declaration "name_of_function" is obscured by a declaration of the same name

I wonder if this can be fixed 🤔

@wesselb
Copy link
Member

wesselb commented Jul 27, 2022

Hey @VolodyaCO! Just letting you know that I've seen your issue. I'll be going on holidays tomorrow. I'll get back to this issue once I'm back!

@VolodyaCO
Copy link
Author

VolodyaCO commented Jul 27, 2022 via email

@wesselb
Copy link
Member

wesselb commented Aug 9, 2022

Hey @VolodyaCO, I’m back again. :) Would you be able to see if the following is perhaps relevant?

#46 (comment)

@VolodyaCO
Copy link
Author

Looks a bit verbose but I think it's alright!

@VolodyaCO
Copy link
Author

With flake8 overloading seems to work, but with pylance it does not 😢
Screenshot 2022-09-04 at 10 25 49 PM

@wesselb
Copy link
Member

wesselb commented Sep 5, 2022

@VolodyaCO, hmm, that's very annoying! I've reopened the issue to record that something is going wrong. I unfortunately won't be able to look at this on the very short term, but I will keep it in mind.

@wesselb wesselb reopened this Sep 5, 2022
@VolodyaCO
Copy link
Author

VolodyaCO commented Sep 5, 2022 via email

@PabloLION
Copy link
Contributor

@wesselb I replied this in a closed issue #46 (comment). I quote it here. (sorry for the repetition)

VSCode lints python with type declaration of this repo. But I know too little about plum to make a PR there😔 Please help🥲

I tried to add static types for other packages (called selenium) before. VS Code buried it deep tho. It's hidden in
https://github.com/python/typeshed/tree/master/stubs of https://github.com/python/typeshed in
https://github.com/microsoft/pyright/tree/main/packages/pyright-internal of https://github.com/microsoft/pyright in
https://github.com/microsoft/pylance-release

I'd be more than appreciated if you can work on it. Thanks in advance!❤️

@wesselb wesselb mentioned this issue Oct 23, 2022
@wesselb
Copy link
Member

wesselb commented Oct 23, 2022

@PabloLION, a brief comment to let you know that I've seen this. I've put this issue on a list of improvements that I'll be working on soon.

@wesselb
Copy link
Member

wesselb commented Sep 23, 2023

I'm closing this issue in favour of #89, which discusses a very similar problem. Note that Plum now supports a particular mypy-compliant pattern based on typing.overload.

@wesselb wesselb closed this as completed Sep 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants