Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4
Some other things you can try or check: Go to a method or function that doesn't have a Docstring (or remove it), select the method/function name so it is highlighted. When the code assistant light bulb shows, click the down arrow and select "Specify return type in docsrting". This should write a Docstring into your function/method in the chosen settings format. Then you should be able to add whatever else you need to the docstring. It should work similarly for classes etc. You can also check in the settings; Settings > Tools > Python Integrated Tool > Docstrings > Docstring format:, Check Analyze Python code in docstrings
24th Jul 2020, 5:53 PM
ChaoticDawg
ChaoticDawg - avatar
+ 3
You can verify you're seeing the correct color or change them by going to Settings > Editor > Color Scheme > Python > Docstring > Tag/Text Also check the Docstring example there and make sure you are following PEP standards so they will show correctly. Be sure to use triple double quotes and not singles. https://www.python.org/dev/peps/pep-0257/
24th Jul 2020, 9:54 AM
ChaoticDawg
ChaoticDawg - avatar
+ 3
You can also try going to the top of the file or some other normal place where a Docstring would be expected and type in 3 single quotes and press enter. Pycharm linting should recognize this as an incorrect Docstring and place the squiggly lines under the quotes. Select the quotes so that the code assistant light bulb shows, click the down arrow and choose the option to change to double quotes. This will give you a Docstring according to your settings.
24th Jul 2020, 5:54 PM
ChaoticDawg
ChaoticDawg - avatar
24th Jul 2020, 6:06 PM
ChaoticDawg
ChaoticDawg - avatar