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
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
ocstring with that string
formatted against the function's module's __dict__.
This supports simple formatted docstrings:
ENVVAR_NAME = 'FUNC_DEFAULT'
@fmtdoc
def func():
"""Do something with os.
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
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 setti