how to comment lot of lines in python
olsongt at verizon.net
olsongt at verizon.net
Fri Mar 31 09:57:10 EST 2006
Eric Deveaud wrote:
> diffuser78 at gmail.com wrote:
> > Like in C we comment like
> > /*
> > Bunch of lines of code
> > */
> >
> > Should we use docstring """ """
>
> I would say NO.
> docstring are displayed by pydoc, thus a pydoc on your code will display some
> inconsistent information ;-)
>
docstrings are a bit of a magical construct. Not all strings in a
function are docstrings.
>>> def foo():
... "real docstring"
... """
... x=1
... """
... print x
...
>>> help(foo)
Help on function foo in module __main__:
foo()
real docstring
>>>
More information about the Python-list
mailing list