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 scope

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_ f

Re: formatted docstrings

2019-04-03 Thread Cameron Simpson
On 04Apr2019 14:14, Cameron Simpson wrote: Is it unreasonable to promote bare format strings as candidates for the docstring? Yes it is. But being annoyed by this I've written this decorator: def fmtdoc(func): ''' Decorator to replace a function's docstring with that string f

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. Default