question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to load docstring into "Help" pane for functions with certain decorators

See original GitHub issue

Issue 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 (or pip, 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?

  1. Install this library, typeguard (https://github.com/agronholm/typeguard) by pip install typeguard
  2. Use the following script:
from typeguard import typechecked

@typechecked
def func(a: int):
    """
    Parameters
    ----------

    a : int
        Something.
    """
    print('someting')

b = func(3)
  1. Move your cursor to func in the last line of the script, and press Ctrl + 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:closed
  • Created 4 years ago
  • Comments:13 (13 by maintainers)

github_iconTop GitHub Comments

1reaction
jsh9commented, Jul 26, 2020

I upgraded Spyder to 4.1.4 (with Jedi 0.17.1), and this issue is solved. Thank you, Spyder developers!

0reactions
ccordoba12commented, Jul 26, 2020

I’m really glad to hear this issue is finally solved for you.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found