__doc__ of current function?

Trevor Taylor xju at telstra.com
Thu Sep 2 09:25:50 CEST 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