As of Sphinx 4, there is a new option we can add to conf.py. I am a little confused about whether "will be integrated into autodoc core" means it will be on by default in the future. But it came in handy in a new library I am working on.
This is not high priority, but it's good to know about.
autodoc_preserve_defaults
If True, the default argument values of functions will be not evaluated on generating document. It preserves them as is in the source code.
New in version 4.0: Added as an experimental feature. This will be integrated into autodoc core in the future.
As of Sphinx 4, there is a new option we can add to
conf.py
. I am a little confused about whether "will be integrated into autodoc core" means it will be on by default in the future. But it came in handy in a new library I am working on.This is not high priority, but it's good to know about.
https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_preserve_defaults