sphinx.ext.autodoc: Keeping names of constants in signature

Since version 4.0 of Sphinx there is a new configuration option (autodoc_preserve_defaults). Setting

autodoc_preserve_defaults = True

in your conf.py will preserve the default values as they are in the source code.

Leave a Comment