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.

Can't turn off docstring auto-generate

See original GitHub issue

Problem Description

I have Spyder installed via Anaconda. I had an installation of 4.1.2 working satisfactorily in my base anaconda environment. I made a new environment for a project, which ended up installing 4.1.3.

It seemed to be working fine until I started writing some code in it and every time I would def something(): and hit ''' on the next line, if I hit enter next (as one does), Spyder would automatically produce an unwanted docstring of several lines.

I spent about 2 hours looking for a way to turn this off. I can’t find one. It’s critically annoying.

I finally decided, since my install in base environment wasn’t giving me any trouble, that I must have messed up a setting, and told Spyder to revert to default settings. Big mistake! Anaconda doesn’t actually make two separate installs of Spyder, settings and active projects, etc are shared between both environments (which I also don’t like, but that’s a separate issue). I lost all my settings in the base environment too, and now it’s doing the same thing (yet still on 4.1.2).

If I type it fast enough, it doesn’t populate, but if I hesitate at all between the last ' and hitting enter, BAM, there it is.

What steps reproduce the problem?

  1. Run Spyder
  2. def something():, hit enter, ''', hit enter.

What is the expected output? What do you see instead?

Only what I typed, not a 4 line useless docstring.

An option to either increase the wait time, or turn it off completely, would be ideal.

I don’t understand why I didn’t have this problem on my previous environment, and now I do. Downgrading the environment’s install to 4.1.2 didn’t help, and the base environment now also has this problem after resetting my settings. 😦

Edit: Alternatively, the ability to customize the output would make it actually useful to me; I’d use it if all it produced was something like this:

def something():
    '''

    '''

Versions

  • Spyder version: 4.1.3

  • Python version: Python 3.8.1 64-bit | Qt 5.9.7 | PyQt5 5.9.2 | Darwin 19.4.0

  • Operating System name/version: OSX Catalina 10.15.4

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ok97465commented, Jul 7, 2020

How about adding “Plain” to docstring type?(like pycharm)

docstring

1reaction
CAM-Gerlachcommented, Jul 7, 2020

@ardunster I originally added it to the bootstrap.py script that launches Spyder in dev mode some years ago, but only now is it being added to Spyder itself. The easiest way to backup your entire config directory is just make a copy of it and name it something else, hehe (its located at ~/.spyder-py3). Spyder does store backups of your config, but if you manually wipe it they won’t get preserved and I tend not to rely on it regardless.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to disable automatic function docstring generation in ...
When you type in the triple quotes, an icon will pop up that says Generate docstring . When this happens, do not hit...
Read more >
3 Easy Steps to Folding Docstrings in VSCode
The first step is to recognise that the auto-generated docstring does ... The online advice appears to indicate that docstrings cannot be ...
Read more >
sphinx.ext.autodoc – Include documentation from docstrings
This extension can import the modules you are documenting, and pull in documentation from docstrings in a semi-automatic way.
Read more >
Docstrings for functions and classes are not generated on ...
PY-15327 Cannot disable the auto-insertion of closing docstring tag ... above (triple quotes on first line in function, still doesn't autogenerate.
Read more >
sphinx.ext.autodoc – Include documentation from docstrings
If set, autodoc will generate document for the members of the target module, ... 'no-flag' , as an option of autodoc directive, to...
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