"spir" wrote
Now what does this function do?
This is a 'what' question, namely, from a design point of view, if I
call
this function, what does it do, and what is its result-value?
What I miss is a good place for "why?". Which, when needed, is different
from "what?" and "how?". Why tells
Le Thu, 16 Apr 2009 12:02:21 +0200,
"A.T.Hofkamp" s'exprima ainsi:
> Now what does this function do?
> This is a 'what' question, namely, from a design point of view, if I call
> this function, what does it do, and what is its result-value?
>
What I miss is a good place for "why?". Which, when
def f(x):
>
> '''f(x) -> x+5'''
> return x+5
>
help(f)
>
> Help on function f in module __main__:
>
> f(x)
> f(x) -> x+5
another thing that has not been mentioned is that if you put
docstrings everywhere, you can use tools like Epydoc, doxygen, or
sphinx to generate full documentation
"mbikinyi brat" wrote
What is really the importance of Docstring in Python???
Some really great comments about comments, however the
significance of docstrings beyond normal comments is that
tools like help() work with them
Thus:
def f(x):
'''f(x) -> x+5'''
return x+5
help(f)
Help
Albert,
That was a great writeup on docstrings. I'm going to share that with my
dev team.
Thank you!
Malcolm
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
mbikinyi brat wrote:
Dear ALL,
What is really the importance of Docstring in Python???
Regards,
Henry
The same as comments, except at function, class, and module level. In
addition, Python provides hooks for extracting that information, and eg put it
in a document such as the standardlib docu
Le Thu, 16 Apr 2009 02:04:25 -0700 (PDT),
mbikinyi brat s'exprima ainsi:
> Dear ALL,
> What is really the importance of Docstring in Python???
> Regards,
> Henry
Very very very great, I guess ;-)
Denis
--
la vita e estrany
___
Tutor maillis
Dear ALL,
What is really the importance of Docstring in Python???
Regards,
Henry
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor