Can't turn off docstring auto-generate
See original GitHub issueProblem 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?
- Run Spyder
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:
- Created 3 years ago
- Comments:14 (9 by maintainers)
Top GitHub Comments
How about adding “Plain” to docstring type?(like pycharm)
@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.