Skip to content

Shows special/magic methods in sphinx docs as the python syntax that invokes them

License

Notifications You must be signed in to change notification settings

sphinx-contrib/prettyspecialmethods

Repository files navigation

Github Actions status

sphinxcontrib-prettyspecialmethods

Shows special methods as the python syntax that invokes them

Overview

This module renders docs like

.. method:: __add__(other)
    Docstring

as

self + other
Docstring

Installing

Install this fork directly from github:

pip install sphinxcontrib-prettyspecialmethods

After installing this module, add the following to your conf.py to enable it

extensions = [
    ...  # your other extensions
    'sphinxcontrib.prettyspecialmethods',
]