[Edu-sig] Top 5 All Time Novice Obstacles => #3 Where am I ?

Lloyd Hugh Allen lha2@columbia.edu
Fri, 20 Sep 2002 06:16:50 -0400


> 11. >>> os.lstat.__doc__
> SG:
> Had a problem with help(os.lstat)? And you were expecting maybe?
> 
> 12. >>> print os.lstat.__doc__
> SG:
> Hey buddy you looking to lstat or are we just playing games here?

The __doc__ attribute of a function is documented (hee hee) in the
tutorial, section 4.7.5. Granted that the tutorial is a lot easier to
understand for folks who already have one language under their belt. It
is also described extensively in Guido's style guide
<http://www.python.org/doc/essays/styleguide.html>, and it is stated
that doc strings should actually be helpful.

Somehow I found out about doc strings, even though I was a newbie
once...assuming that folks are learning Python with access to the web,
and that they are reading tutorials and documentation instead of typing
random characters a la Shakespearian monkeys waiting for a Python port
of Unreal Tournament to appear on their terminal, they should be able to
find doc strings fairly quickly. I know they're one of the first
features that I teach, when I teach Python each summer.