"Colin J. Williams" <c...@ncf.ca> writes: > On 10-Jul-11 13:44 PM, rantingrick wrote: > > On Jul 10, 12:41 pm, Tim Johnson<t...@johnsons-web.com> wrote: > >> It possible for a function to print it's own docstring? > > > > def f(): > > """docstring""" > > print "docstring" > > Try: > > def f(): > ds= """docstring""" > print ds
The OP wants the function to print its own docstring, which your example does not do. You've defined a function with an empty docstring. >>> def foo(): ... ds = "The Larch" ... print ds ... >>> foo.__doc__ >>> -- \ “Firmness in decision is often merely a form of stupidity. It | `\ indicates an inability to think the same thing out twice.” | _o__) —Henry L. Mencken | Ben Finney -- http://mail.python.org/mailman/listinfo/python-list