On Sun, Dec 5, 2010 at 12:31 PM, Zac Burns
Including additional information from the module:
class Colors(Enum): RED = (255, 0, 0)
def acceptsColor(color): """ color could be any: %s """ % '\n\t'.join('Color.' + color for color in publicDir(Colors))
Just roll your own decorator if you want to do something like this: def format_docstring(*args, **kwds): def docstringFormatter(f): fmt = f.__doc__ f.__doc__ = fmt.format(*args, **kwds) return f return docstringFormatter @format_docstring("Any text you like") def sample(): """Include a supplied string in the docstring: {} """ help(sample) ============================= Help on function sample in module __main__: sample() Include a supplied string in the docstring: Any text you like ============================= Cheers, Nick. -- Nick Coghlan | ncoghlan@gmail.com | Brisbane, Australia