[Python] How to document an exception using Sphinx?

Discussão em 'Python' iniciado por Stack, Setembro 14, 2025.

  1. Stack

    Stack Membro Participativo

    I can't seem to figure out how to document exceptions using Sphinx.

    I've tried the following:

    def some_funct():
    """
    :raises: ExceptionType: Some multi-line
    exception description.
    """


    Sphinx keeps saying:


    "Field list ends without a blank line; unexpected unindent."
    ​

    So how do I get rid of the message and what is the proper way to document possibly multiple exceptions with multiple-line documentation?

    Continue reading...

Compartilhe esta Página