Why doesn't dynamically formatting docstrings work? Is there an acceptable workaround for doing this at function definition time?
>>> DEFAULT_BAR = "moe's tavern"
>>> def foo(bar=DEFAULT_BAR):
... """
... hello this is the docstring
...
... Args:
... bar (str) the bar argument (default: {})
... """.format(DEFAULT_BAR)
... pass
...
>>> foo.__doc__
>>> foo.__doc__ is None
True
I tried with old-skool style %s formatting and that didn't work either.