free hit counter

Monday, April 10, 2006

python doc strings

To see a python functions doc string use its __doc__ property:

print math.atan2.__doc__

If you're doing this in a larger script it may be more helpful to use str(foo.__doc__) because function foo may not have a doc string and if it is null, str will nicely print 'None'


Post a Comment

<< Home