__doc__ of current function?

Trevor Taylor xju at telstra.com
Thu Sep 2 03:25:50 EDT 2004


Hi,

I thought it would be simple but couldn't figure it out, nor find it
addressed already:

I can do:

def validatePassword(p):
   'do something'
   print validatePassword.__doc__

... can I write a general docOfCurrentFunction() function so that I
can rewrite it:

def validatePassword(p):
   'do something'
   print docOfCurrentFunction()

Thanks,

Trevor



More information about the Python-list mailing list