Documentation string

Fredrik Lundh fredrik at pythonware.com
Thu Aug 26 08:47:25 EDT 1999


sp00fD <sp00fD at yahoo.com> wrote:
> Can someone tell me why the
> 
> def foo(self):
> """A method"""
> 
> won't work?

a docstring is a actually a statement (to be
exact, it's an expression statement with no
side effects).

in other words, docstrings have to be properly
indented, just like all other statements in the
function body.

</F>





More information about the Python-list mailing list