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

StopIteration has wrong __init__ doc #653

Closed
jeffreyyjp opened this issue Nov 27, 2020 · 6 comments
Closed

StopIteration has wrong __init__ doc #653

jeffreyyjp opened this issue Nov 27, 2020 · 6 comments
Assignees
Labels
bug Something isn't working docstrings fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@jeffreyyjp
Copy link

Environment data

  • Language Server version: v2020.11.2
  • OS and version: 10.15.7
  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.2

Expected behaviour

Show each specific info for Exception

Actual behaviour

image

Logs

XXX

Code Snippet / Additional information

XXX
@judej judej added the bug Something isn't working label Nov 30, 2020
@github-actions github-actions bot removed the triage label Nov 30, 2020
@jakebailey jakebailey self-assigned this Nov 30, 2020
@jakebailey
Copy link
Member

There's some inconsistency here. When just the type is present:

image

But when it's called, the __init__ function's doc is used:

image

But, I can see in the generated file for the builtin docstrings that it should be working:

image

So, very likely a bug in the docstring fetching code for init methods.

@erictraut
Copy link
Contributor

erictraut commented Nov 30, 2020

The problem here is that these subclassed exceptions don't have an __init__ method override, so we're finding the __init__ in the base class, and we're picking up the docstring from that class.

@jakebailey
Copy link
Member

Ah, yeah. That's what I thought. I'm thinking that there would need to be an alternate traversal that checks the shadow files for docs rather than the regular type lookup that doesn't consider it.

@yvvt0379
Copy link

Excuse me, but when will this problem be solved? It's been quite a long time since this issue was opened. JediLSP is doing the correct behavior. So when will Pylance?

@jakebailey jakebailey added docstrings needs investigation Could be an issue - needs investigation labels Aug 31, 2021
@jakebailey jakebailey changed the title some built-in Exception doesn't show right hover info StopIteration has wrong __init__ doc Sep 2, 2021
@jakebailey jakebailey added fixed in next version (main) A fix has been implemented and will appear in an upcoming version and removed needs investigation Could be an issue - needs investigation labels Sep 7, 2021
@jakebailey
Copy link
Member

The next version should fix this particular case (inheriting object's docs), though the whole source mapping when typeshed and our scraped output mismatch is another problem.

@jakebailey
Copy link
Member

This issue has been fixed in version 2021.9.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202191-8-september-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docstrings fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

6 participants