Oops, you're right.
What I should have said is to use a blank docstring as
follows:
""""""
"""Function docstring."""
def foo:
...
or:
"""Module docstring."""
"""""&quo
t;
def foo:
...
So the first docstring is the module docstring, and
the next is the first class/function. And again, if
there's only one, it will belong to both.
--- Anthony Baxter <[EMAIL PROTECTED]> wrote:
> On Monday 21 March 2005 20:08, Nicholas Jacobson
> wrote:
>
Rule #1: If the docstring is the first line of a
module, it's the module's docstring.
Rule #2: If the docstring comes right before a
class/function, it's that class/function's docstring.
> How do you distinguish between a docstring at the
> top of a module
> that's immediately followed by a fun
IIRC, Guido once mentioned that he regretted not
setting function docstrings to come before the
function declaration line, instead of after.
i.e.
"""This describes class Bar."""
class Bar:
...
Or with a decorator:
"""This describes class Bar."""
@classmethod
class Bar:
...
Versus the curre