-
Notifications
You must be signed in to change notification settings - Fork 771
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
Missing docstrings for builtins #49
Comments
Additionally Replicated on:
|
That's #37. |
Hi, Here are some cases where pylance gives docstrings in pandas: |
This bug is specifically about the docstrings for builtins, which are distinct from the docstrings for other modules in that there is no file that can be read that contains the docstrings. Our pandas type stubs mirror some of the docstrings to make sure we can access them (as pandas produces the docstrings at runtime from templates, defeating any static type checker that doesn't literally want to execute the code to try and pull info). If there are specific methods in pandas that we're missing or show inconsistently, I would suggest making a new issue, as the fix for that is going to be quite different than the fix for the builtins. |
Thanks Jake. I appreciate the response. And thanks to the whole team for the work they've put into the tooling. I apologise for mis-filing this issue. |
sir, when will patch this issue? |
Hopefully soon (this is the top voted issue, after all), but I don't have a timeframe at the moment, sorry. |
This issue seems to be fairly specifically about builtins, although on my side the stubs without docstring (pylance shows this) vs source+docstring (pylance does not show this) issue does seem to be at play. I have moved my comment to issue #170 which seems to be a better fit. |
When will resolve the issue? |
This is being worked on, and we will update this issue when it's finished and available. |
I'm happy to say that the next release (tomorrow?) will enable this: It's going to be limited to the builtins for now, i.e. what you get in the global scope. There are other standard library modules that are compiled that could benefit from this, but that'll take a bit more effort to implement correctly and we'd like to continue to work on the compiled module story as a whole before expanding things. |
This issue has been fixed in version 2020.9.6, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202096-23-september-2020 |
We definitely show info for your own functions. Based on the signature, that function appears to be using |
Just wondering: has this issue also been fixed in pyright? |
No, the functionality to do this is implemented in Pylance (and doesn't affect type checking, only editor features). The builtins are compiled and that whole thing isn't quite settled; this is just a specific special case that we wanted to try out. |
I am using the extension with Python 3.8.3. On hover for any function, the tooltip shows only the type information (of parameters, return value etc.).
I'd prefer it showing the documentation of the function (wherever available) as well, so that it is clear what the function is being used for. This can be seen demonstrated in the Pylance announcement blog post for the pandas library.
Environment data
Expected behaviour
Before installing pylance

Actual behaviour
After installing pylance

The text was updated successfully, but these errors were encountered: