Unable to load docstring into "Help" pane for functions with certain decorators
See original GitHub issueIssue Report Checklist
- Searched the issues page for similar reports
- Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda) - Could not reproduce inside
jupyter qtconsole
(if console-related) - Tried basic troubleshooting (if a bug/error)
- Restarted Spyder
- Reset preferences with
spyder --reset
- Reinstalled the latest version of Anaconda
- Tried the other applicable steps from the Troubleshooting Guide
- Completed the Problem Description, Steps to Reproduce and Version sections below
Problem Description
What steps reproduce the problem?
- Install this library,
typeguard
(https://github.com/agronholm/typeguard) bypip install typeguard
- Use the following script:
from typeguard import typechecked
@typechecked
def func(a: int):
"""
Parameters
----------
a : int
Something.
"""
print('someting')
b = func(3)
- Move your cursor to
func
in the last line of the script, and pressCtrl + I
(“inspect current object”).
What is the expected output? What do you see instead?
The docstring cannot be loaded into the “Help” pane.
However, if you comment out the line @typechecked
, and then press Ctrl + I
(with the cursor on func
), you will be able to see the docstring correctly loaded.
Versions
- Spyder version: 4.0.0
- Python version: 3.7.3
- Qt version: 5.9.6
- PyQt version: 5.9.3
- Operating System name/version: Windows 10 and Ubuntu 18.04
Dependencies
cloudpickle >=0.5.0 : 1.2.2 (OK)
pygments >=2.0 : 2.4.2 (OK)
qtconsole >=4.6.0 : 4.6.0 (OK)
nbconvert >=4.0 : 5.6.1 (OK)
sphinx >=0.6.6 : 2.2.1 (OK)
pylint >=0.25 : 2.4.4 (OK)
psutil >=0.3 : 5.6.5 (OK)
qtawesome >=0.5.7 : 0.6.0 (OK)
qtpy >=1.5.0 : 1.9.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
zmq >=17 : 18.1.0 (OK)
chardet >=2.0.0 : 3.0.4 (OK)
numpydoc >=0.6.0 : 0.9.1 (OK)
spyder_kernels >=1.8.1;<2.0.0: 1.8.1 (OK)
qdarkstyle >=2.7 : 2.7 (OK)
atomicwrites >=1.2.0 : 1.3.0 (OK)
diff_match_patch >=20181111 : 20181111 (OK)
intervaltree : None (OK)
watchdog : None (OK)
keyring : None (OK)
pexpect >=4.4.0 : 4.7.0 (OK)
pympler : None (OK)
sympy >=0.7.3 : 1.4 (OK)
cython >=0.21 : 0.29.14 (OK)
IPython >=4.0 : 7.9.0 (OK)
matplotlib >=2.0.0 : 3.0.3 (OK)
pandas >=0.13.1 : 0.25.3 (OK)
numpy >=1.7 : 1.17.3 (OK)
scipy >=0.17.0 : 1.3.1 (OK)
pyls >=0.31.2;<0.32.0 : 0.31.2 (OK)
rtree >=0.8.3 : 0.8.3 (OK)
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Python decorator handling docstrings - Stack Overflow
I've recently been failing to get the help description correct for decorated functions - it seems a pretty poor state of affairs, but...
Read more >PyXLL User Guide
When PyXLL starts up it loads those modules and exposes certain functions that have been tagged with PyXLL decorators. For example, an Excel...
Read more >1.1.7 (core) / 0.17.7 (libraries) - Dagster Docs
Fixed an issue where Dagster failed to load a dagster.yaml file that ... Docstrings on functions decorated with the @resource decorator will now...
Read more >PySimpleGUI
Docstrings enable you to access help directly from Python or your IDE; Searching the GitHub Issues as a last resort (search both open...
Read more >Changelog - Sphinx documentation
#10738: napoleon: Add support for docstring types using 'of', like type of ... #9555: autosummary: Improve error messages on failure to load target...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I upgraded Spyder to 4.1.4 (with Jedi 0.17.1), and this issue is solved. Thank you, Spyder developers!
I’m really glad to hear this issue is finally solved for you.