PyCharm 2026.1.2 Docstring stubs can only be generated with AI? How may I enable the previous version of this?
PyCharm once had a very simple, cool and lightening fast docstring stub feature but for the life of me I cannot figure out how to get it back.
File | Settings | Python | Tools | Integrated Tools | Docstrings | (Project doesn't matter) …
- Docstring Format (nothing here matters)
- Analyze Python code in docstrings (checked or not, doesn't matter)
- Render external documentation (checked or not, doesn't matter)
The above settings were all that were needed before. Now, opening up a docstring in a method or class only shows a hint to “Generate with AI assistant”. If I try to ALT+ENTER a menu is shown and there is no option available that provides the previous stub behavior.
How can I enable the previous behavior where all parameters and the return are stubbed in automatically (Google or reStructuredText)?
See here for what I mean https://www.jetbrains.com/help/pycharm/creating-documentation-comments.html#create_pydoc
There is no “insert a documentation string stub” option and I cannot figure out how to do it automatically short of writing it out manually.
Help?
Please sign in to leave a comment.
Hi Victor B. Gonzalez,
The stub generator is still there. The "Generate with AI assistant" hint is a separate inlay, not a replacement.
Two ways to insert a stub:
- Put the caret on the name of a function that has no docstring yet, press
Alt+Enter, and pick "Insert a documentation string stub". The intention is offered only on the function name, so pressingAlt+Enterfrom inside the body, or from inside an already-opened""", will not show the option.- Type
"""on the line under thedefand press Enter. That path needs "Insert documentation comment stub" enabled at Settings | Editor | General | Smart Keys.Parameter and return tags come from the docstring format at Settings | Python | Tools | Integrated Tools, so set that to
reStructuredTextorGooglerather than Plain.Both help pages get this wrong, which explains most of the trouble. PY-91286 covers the Smart Keys page claiming the checkbox does not apply to Python, and PY-91287 the wrong caret position in the "Create documentation comments" steps.
Mikhail Tarabrikov thank you for assuring me of the “insert a documentation string stub” by pressing alt+enter on a function/method name. That actually works.
Yesterday, I was a bit impatient. I upgraded to 2026.2.0.1 and still couldn't solve it on my own. Being faced with other small issues (which all added up), I decided to completely blow out my installation and redo everything from scratch. So far, after putting it all back in order, I'm suddenly being faced with some new issues but the documentation stubs are working :)
Thank you for the help and links, it's much appreciated <3
I don't know how to mark my post as “answered”. I would have been happy with Mikhail Tarabrikov answer (which most likely would have solved my issue).