Skip to content

blank-line-after-function (D202)

Derived from the pydocstyle linter.

Fix is sometimes available.

What it does

Checks for docstrings on functions that are separated by one or more blank lines from the function body.

Why is this bad?

Remove any blank lines between the function body and the function docstring, for consistency.

Example

def average(values: list[float]) -> float:
    """Return the mean of the given values."""

    return sum(values) / len(values)

Use instead:

def average(values: list[float]) -> float:
    """Return the mean of the given values."""
    return sum(values) / len(values)

References

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy