-
-
Notifications
You must be signed in to change notification settings - Fork 513
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
If a decorator changes the function docstring, I would like to have the changed function doc displayed in the tooltip. #1921
Comments
Did you try to use |
Hey @davidhalter , Thanks for your quick reply. Using functool.wraps doesn't change the tooltip.
This will have the output: "A simple function to print Hello". So it ignores the assigned docstring in the wrapper for the function. If I assign inside the wrapper the But the Tooltip never changes and always displays the docstring from the function itself. |
Oh ok, now I get it. I misunderstood you at first. This is something that I definitely do not want to support, because it's a side effect and it's very hard to deal with for very little gains. So, I'm sorry but this won't happen. |
I however just realized that you might be using it with an |
Since you @Nlea wrote that you are using an |
At the moment, Jedi makes an IDE like VS Code display the docstring of a function. Even though the function might have a decorator that changes the docstring of the function.
Example:
If I call
help(sayHello)
. I get the wrapper docs printed. If would usefunctools
that would change, but then I change the function docs insight the wrapper.If I hover over the function
sayHello
I get: “A simple function to print Hello”. What I would like to see is: “A simple function to print hello and some other stuff”, because the docstring was modified in the wrapper.Is there a way that this could be included in the Jedi Logic? So that whenever a decorator changes the docstring of a function, the changed docstring is displayed instead of the static docstring from the function itself?
If you would be willing to accept a PR, I would be happy to work on it!
The text was updated successfully, but these errors were encountered: