formatted docstrings

Cameron Simpson cs at
Wed Apr 3 23:05:17 EDT 2019

I just wrote this (specifics changed for confidentiality reasons):


  def get_handle(setting=None):
    f'''Get a handle.

        * `setting`: the application setting.
          Default from the {DEFAULT_ENVVAR} environment variable.
    if setting is None:
      setting = os.environ[DEFAULT_ENVVAR]

I thought this was way cool. Until I disovered that there was no 
docstring because a format string is not a string literal.

Is it unreasonable to promote bare format strings as candidates for the 

Cameron Simpson <cs at>

More information about the Python-list mailing list