adafruit / cookiecutter-adafruit-circuitpython

Cookiecutter template for Adafruit's CircuitPython libraries.
MIT License
22 stars 37 forks source link

Use autodoc_preserve_defaults = True #170

Closed dhalbert closed 1 year ago

dhalbert commented 2 years ago

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

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.