2011/8/30 Sebastian Rahlf <[email protected]>: > Hi! > > I'm using Sphinx's autodoc feature to document my API. For example:: > > DEFAULT_OPTION = 'default' > def do_something(msg, option=DEFAULT_OPTION): > print msg > > The generated documentation now shows the following signature: > > do_something(msg, option='default') > > How can I tell Sphinx to keep the name of the constant value?
Most likely you can't. Python evaluates "DEFAULT_OPTION" during import, thus the constant is long gone when Sphinx looks at the *imported* module to extract documentation from it. > If at all possible, I'd like NOT to write all signature by hand again. Seems to be the only way. -- You received this message because you are subscribed to the Google Groups "sphinx-dev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sphinx-dev?hl=en.
