Function docstring as a local variable

Tim Johnson tim at johnsons-web.com
Sun Jul 10 16:34:36 EDT 2011


* Andrew Berg <bahamutzero8825 at gmail.com> [110710 09:59]:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: RIPEMD160
> 
> On 2011.07.10 12:41 PM, Tim Johnson wrote:
> > It possible for a function to print it's own docstring?
> >>> def test():
> ...     """Hi there."""
> ...     print(test.__doc__)
  Holy Moly. Of course!
  thanks
-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com



More information about the Python-list mailing list