[gobolinux-users] Gobo wants you! (to comment its scripts)

Michael Homer michael at gobolinux.org
Tue Apr 8 10:49:44 NZST 2008


On Tue, Apr 8, 2008 at 4:25 AM, Benjamin Bruheim <grolgh at gmail.com> wrote:
> Hi,
>
>  Python do have docstrings.
>
>  def foo():
>   "This is a single line docstring"
>   ....
>
>  def foo():
>   """This is a multiline docstring
>   Like this..."""
>   ...
Although that will work, there's a pretty strong convention to use the
triple quotes for all docstrings, even the one-liners. PEP 257 covers
what they're meant to look like:
http://www.python.org/dev/peps/pep-0257/ (pretty thoroughly, really).
For the how and why of the internals of a method, regular comments are
still the right way to do it.

For the shell scripts just comments will have to suffice, but that'd
be a pretty good way of structuring the function comments there too.
-Michael


More information about the gobolinux-users mailing list