Yes, you only need the type hints OR the annotations in the Args and Returns, not both.


References

According to the Google Python Style Guide: "The description should include required type(s) if the code does not contain a corresponding type annotation."

The Sphinx Docs also encourage this in their example code:


def function_with_pep484_type_annotations(param1: int, param2: str) -> bool:
    """Example function with PEP 484 type annotations.

    Args:
        param1: The first parameter.
        param2: The second parameter.

    Returns:
        The return value. True for success, False otherwise.

    """
Answer from Kris Gesling on Stack Overflow
🌐
Google
google.github.io › styleguide › pyguide.html
Google Python Style Guide
Python uses docstrings to document code. A docstring is a string that is the first statement in a package, module, class or function. These strings can be extracted automatically through the __doc__ member of the object and are used by pydoc. (Try running pydoc on your module to see how it looks.)
🌐
Readthedocs
sphinxcontrib-napoleon.readthedocs.io › en › latest › example_google.html
Example Google Style Python Docstrings — napoleon 0.7 documentation
Todo: * For module TODOs * You have to also use ``sphinx.ext.todo`` extension .. _Google Python Style Guide: http://google.github.io/styleguide/pyguide.html """ module_level_variable1 = 12345 module_level_variable2 = 98765 """int: Module level variable documented inline. The docstring may span multiple lines.
Discussions

python - Type annotations with google style docstrings - Stack Overflow
When using google style docstrings and type annotations there's a double up of the type hints. Is there any community consensus on how to avoid this? Annoying double up of types: def sum(a: int, b:... More on stackoverflow.com
🌐 stackoverflow.com
coding style - What are the most common Python docstring formats? - Stack Overflow
You can add sphinx google style example as well. Great answer btw. EDIT: I edited your answer by myself. 2016-07-07T11:09:09.5Z+00:00 ... good answer. I dare say where you can change default docstring format in PyCharm (JetBrains): Settings --> Tools --> Python Integrated Tools --> Docstring format. More on stackoverflow.com
🌐 stackoverflow.com
My thoughts on docstrings, pdoc and Google style vs. Markdown
Why not use fastapi? Probably the most standard python API package and already does all of this via the swagger integration. More on reddit.com
🌐 r/learnpython
10
2
September 18, 2025
Confused by Google's docstring "Attributes" section.
For what it's worth, there's all kinds of docstring conventions. Most derive from PEP-257. The one Google uses isn't necessarily the most common, nor best, depending on the project. I do not think you've misunderstood anything. Au contraire, the simplest explanation would be that PyCharm's tooltips simply don't support said section. More on reddit.com
🌐 r/learnpython
4
1
April 19, 2023
🌐
GitHub
gist.github.com › redlotus › 3bc387c2591e3e908c9b63b97b11d24e
Google Style Python Docstrings · GitHub
Google Style Python Docstrings. GitHub Gist: instantly share code, notes, and snippets.
🌐
Mit
drake.mit.edu › styleguide › pyguide.html
Google Python Style Guide for Drake
Files should start with a docstring describing the contents and usage of the module. ```python """A one-line summary of the module or program, terminated by a period. Leave one blank line. The rest of this docstring should contain an overall description of the module or program.
Find elsewhere
🌐
Sphinx
sphinx-doc.org › en › master › usage › extensions › napoleon.html
sphinx.ext.napoleon – Support for NumPy and Google style docstrings — Sphinx documentation
Google style tends to be easier to read for short and simple docstrings, whereas NumPy style tends be easier to read for long and in-depth docstrings. The choice between styles is largely aesthetic, but the two styles should not be mixed. Choose one style for your project and be consistent with it.
Top answer
1 of 6
1389

Formats

Python docstrings can be written following several formats as the other posts showed. However the default Sphinx docstring format was not mentioned and is based on reStructuredText (reST). You can get some information about the main formats in this blog post.

Note that the reST is recommended by the PEP 287

There follows the main used formats for docstrings.

- Epytext

Historically a javadoc like style was prevalent, so it was taken as a base for Epydoc (with the called Epytext format) to generate documentation.

Example:

"""
This is a javadoc style.

@param param1: this is a first param
@param param2: this is a second param
@return: this is a description of what is returned
@raise keyError: raises an exception
"""

- reST

Nowadays, the probably more prevalent format is the reStructuredText (reST) format that is used by Sphinx to generate documentation. Note: it is used by default in JetBrains PyCharm (type triple quotes after defining a method and hit enter). It is also used by default as output format in Pyment.

Example:

"""
This is a reST style.

:param param1: this is a first param
:param param2: this is a second param
:returns: this is a description of what is returned
:raises keyError: raises an exception
"""

- Google

Google has their own format that is often used. It also can be interpreted by Sphinx (ie. using Napoleon plugin).

Example:

"""
This is an example of Google style.

Args:
    param1: This is the first param.
    param2: This is a second param.

Returns:
    This is a description of what is returned.

Raises:
    KeyError: Raises an exception.
"""

Even more examples

- Numpydoc

Note that Numpy recommend to follow their own numpydoc based on Google format and usable by Sphinx.

"""
My numpydoc description of a kind
of very exhautive numpydoc format docstring.

Parameters
----------
first : array_like
    the 1st param name `first`
second :
    the 2nd param
third : {'value', 'other'}, optional
    the 3rd param, by default 'value'

Returns
-------
string
    a value in a string

Raises
------
KeyError
    when a key error
OtherError
    when an other error
"""

Converting/Generating

It is possible to use a tool like Pyment to automatically generate docstrings to a Python project not yet documented, or to convert existing docstrings (can be mixing several formats) from a format to an other one.

Note: The examples are taken from the Pyment documentation

2 of 6
354

The Google style guide contains an excellent Python style guide. It includes conventions for readable docstring syntax that offers better guidance than PEP-257. For example:

def square_root(n):
    """Calculate the square root of a number.

    Args:
        n: the number to get the square root of.
    Returns:
        the square root of n.
    Raises:
        TypeError: if n is not a number.
        ValueError: if n is negative.

    """
    pass

I like to extend this to also include type information in the arguments, as described in this Sphinx documentation tutorial. For example:

def add_value(self, value):
    """Add a new value.

       Args:
           value (str): the value to add.
    """
    pass
🌐
Josh Di Mella
joshdimella.com › blog › python-docstring-formats-best-practices
A Guide to Python Docstring Formats: Choosing the Right Style for Your Code | Josh Di Mella | Software Engineer
May 31, 2023 - Google style docstrings follow a structured format and are widely adopted in the Python community. They consist of a summary line, detailed explanations, and specific sections for parameters, return values, and raised exceptions.
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-docstrings
Python Docstrings - GeeksforGeeks
September 19, 2025 - Google style docstrings follow a specific format and are inspired by Google's documentation style guide. They provide a structured way to document Python code, including parameters, return values and descriptions.
🌐
Reddit
reddit.com › r/learnpython › my thoughts on docstrings, pdoc and google style vs. markdown
r/learnpython on Reddit: My thoughts on docstrings, pdoc and Google style vs. Markdown
September 18, 2025 -

So, I wanted to add some API documentation to my project. Unfortunately, there are many competing standards/styles and many tools to generate HTML documentation.

Initially I chose pdoc, as it seems simple, does the job well and requires zero configuration. So far, so good. The problem is that is doesn't FULLY support ANY of the most popular docstring standards - ReStructuredText, Google, NumPy; instead, it uses its own style based on Markdown. I actually find it nice & clean, because:

  • you don't need to specify variable/attribute/arg types if you already have type hints in your code

  • you document instance/class variables right after they are declared (not in class docstring)

  • similarly, you document _init__ constructor right after it is declared, not in the class docstring

The problem is that - besides pdoc itself - no one really recognizes its Markdown standard. It's not supported by PyCharm, pyment, pymend, nor by other tools.

However! According to Sphinx/Napoleon Example Google Style Python Docstrings, it is totally possible to use the Google docstrings style in a similar way - i.e, the 3 bullet points above would still work!

So, I could simply use Google style (which is a recognized standard) in a way I would use pdoc's Markdown. The only thing to make sure is not to use the Attributes: and Methods: sections in class docstring, as it would appear as duplicate in generated HTML. I would still use sections Args: Returns: Yields: and Raises: in function docstrings, where applicable.

And my commandline to run pdoc would be:

pdoc modulename -o docs --docformat google --no-show-source

What do you guys think?

PS. One minor downside of placing docstrings after variable declarations is that they do NOT become __doc__, as they do in the case of modules, classes and functions. So, these comments would not be discoverable programmatically (or interactively via help()). But I guess it doesn't matter that much...

🌐
Real Python
realpython.com › how-to-write-docstrings-in-python
How to Write Docstrings in Python – Real Python
August 25, 2025 - Google-style docstrings provide a clean, structured way to document your code, especially when it’s concerned with multiple parameters or returns complex values. They became popular through Google’s Python projects and other large codebases.
🌐
Better Programming
betterprogramming.pub › 3-different-docstring-formats-for-python-d27be81e0d68
3 Different Docstring Formats for Python | by Yash Salvi | Better Programming
April 27, 2022 - This docstring format is recommended by Khan Academy and is popularly known as “Google Docstring”. To make sure the docstring is compatible with Sphinx and is recognized by Sphinx’s autodoc, add the sphinx.ext.napoleon extension in the conf.py file.
🌐
Reddit
reddit.com › r/learnpython › confused by google's docstring "attributes" section.
r/learnpython on Reddit: Confused by Google's docstring "Attributes" section.
April 19, 2023 -

I just found out docstring conventions and Google's seems to be one people use and it looks pretty readable so I thought I'd add docstrings according to that.

However, I have no idea how Attributes: work.

First, I am using pycharm and have put the Google style in the Python Integrated Tools section, and it seems to work. I do get automatic docstring stub when I do """ """, though it does not seem to work for classes, just functions.

According to the Google styleguide section 3.8.4 you should use Attributes: section for public attributes. But it does not seem to do anything when it comes to showing the help.

If I take the sample class file in the styleguide, the Attributes: section doesn't show anywhere. Howering mouse over the SampleClass only shows the summary and the two rows after that and nothing more. Using the ctrl+Q shortcut to show the documentation shows the same thing. Screenshot here.

Same thing using the Google stylesheet example file from Sphinx. The Attributes: does not show up. Inline formatted or under the section. Screenshot here.

Is this a PyCharm issue or am I misunderstanding the idea behind the section?

🌐
Readthedocs
sphinx-rtd-tutorial.readthedocs.io › en › latest › docstrings.html
Writing docstrings — Sphinx-RTD-Tutorial documentation
There are several different docstring formats which one can use in order to enable Sphinx’s autodoc extension to automatically generate documentation. For this tutorial we will use the Sphinx format, since, as the name suggests, it is the standard format used with Sphinx. Other formats include Google (see here) and NumPy (see here), but they require the use of Sphinx’s napoleon extension, which is beyond the scope of this tutorial.
🌐
GitHub
github.com › PyCQA › pydocstyle
GitHub - PyCQA/pydocstyle: docstring style checker · GitHub
November 3, 2023 - pydocstyle is a static analysis tool for checking compliance with Python docstring conventions.
Author: PyCQA
🌐
Mkdocstrings
mkdocstrings.github.io › python › usage › configuration › docstrings
Docstrings - mkdocstrings-python
The docstring style to expect when parsing docstrings. Possible values: "google": see Google style. "numpy": see Numpy style. "sphinx": see Sphinx style. None (null or ~ in YAML): no style at all, parse as regular text. in mkdocs.yml (global configuration) plugins: - mkdocstrings: handlers: python: options: docstring_style: google ·
🌐
Reddit
reddit.com › r/python › google python style guide
r/Python on Reddit: Google Python Style Guide
February 11, 2023 - Confused by Google's docstring "Attributes" section. ... The Move to Python 3 Begins!
🌐
Python
peps.python.org › pep-0008
PEP 8 – Style Guide for Python Code | peps.python.org
For flowing long blocks of text with fewer structural restrictions (docstrings or comments), the line length should be limited to 72 characters.