Re: formatted docstrings

2019-04-03 Thread Cameron Simpson
On 04Apr2019 15:40, Ben Finney wrote: Cameron Simpson writes: To answer my own question ... On 04Apr2019 14:05, Cameron Simpson wrote: > Is it unreasonable to promote bare format strings as candidates for > the docstring? Sigh. Because such a string _should_ be evaluated in the runtime

Re: formatted docstrings

2019-04-03 Thread Ben Finney
Cameron Simpson writes: > To answer my own question ... > > On 04Apr2019 14:05, Cameron Simpson wrote: > > Is it unreasonable to promote bare format strings as candidates for > > the docstring? > > Sigh. Because such a string _should_ be evaluated in the runtime scope > context of the _called_

Re: formatted docstrings

2019-04-03 Thread Cameron Simpson
formatted against the function's module's __dict__. This supports simple formatted docstrings: ENVVAR_NAME = 'FUNC_DEFAULT' @fmtdoc def func(): """Do something with os.environ[{ENVVAR_NAME}]."""

Re: formatted docstrings

2019-04-03 Thread Cameron Simpson
To answer my own question ... On 04Apr2019 14:05, Cameron Simpson wrote: I just wrote this (specifics changed for confidentiality reasons): DEFAULT_ENVVAR = 'APP_VALUE' def get_handle(setting=None): f'''Get a handle. Parameter: * `setting`: the application setting.

formatted docstrings

2019-04-03 Thread Cameron Simpson
I just wrote this (specifics changed for confidentiality reasons): DEFAULT_ENVVAR = 'APP_VALUE' def get_handle(setting=None): f'''Get a handle. Parameter: * `setting`: the application setting. Default from the {DEFAULT_ENVVAR} environment variable. ''' if