Skip to content

Commit

Permalink
docs: make autodoc preserve default arguments without evaluating them
Browse files Browse the repository at this point in the history
This is a supposedly "experimental" option that was added in Sphinx 4.0,
but here we are using Sphinx 7.1.x and it still hasn't been added to
autodoc core as planned.

Turning it on fixes the display of default parameters values like
`tools.memories._NO_DEFAULT` in function/method signatures.

Admittedly, I have not checked through the entire documentation set
again after enabling this, but it seems unlikely that there are ever
cases where we want the evaluated value to display instead of how it's
passed in the source code.
  • Loading branch information
dgw committed Nov 12, 2023
1 parent ec02c17 commit 57f8c27
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@
'ModeDetails': 'sopel.irc.modes.ModeDetails',
'PrivilegeDetails': 'sopel.irc.modes.PrivilegeDetails',
}
autodoc_preserve_defaults = True


# -- Options for HTML output ---------------------------------------------------
Expand Down

0 comments on commit 57f8c27

Please sign in to comment.