Documentation string

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

sp00fD <sp00fD at> 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.


More information about the Python-list mailing list