On Tuesday 22 March 2005 05:58, Nicholas Jacobson wrote:
> Oops, you're right.
>
> What I should have said is to use a blank docstring as
> follows:
It's still unclear to me what a file containing a single docstring
followed by a def() line means. And this ambiguity doesn't seem
to be solvable, so
Oops, you're right.
What I should have said is to use a blank docstring as
follows:
""
"""Function docstring."""
def foo:
...
or:
"""Module docstring."""
""
def foo:
...
--- Anthony Baxter <[EMAIL PROTECTED]> wrote:
> On Monday 21 March 2005 20:08, Nicholas Jacobson
> wrote:
>
Oops, you're right.
What I should have said is to use an empty docstring
as
follows:
""
"""Function docstring."""
def foo:
...
or:
"""Module docstring."""
""
def foo:
...
So the first docstring is the module docstring, and
the next is the first class/function. And again, if
th
Nicholas Jacobson wrote:
If a programmer wanted a docstring for the function
but not the module, a blank first line would do the
trick. A docstring for the module but not the
function? Put a blank line between the module's
docstring and the function.
-1 on all this making of blank lines significa
Nicholas Jacobson wrote:
IIRC, Guido once mentioned that he regretted not
setting function docstrings to come before the
function declaration line, instead of after.
He did, but I don't know how strong that regret is.
i.e.
"""This describes class Bar."""
class Bar:
...
Or with a decorator:
"""This
On Monday 21 March 2005 20:08, Nicholas Jacobson wrote:
> > How do you distinguish between a docstring at the
> > top of a module
> > that's immediately followed by a function? Is it
> > the module docstring
> > or the function docstring?
>
> It's both. The docstring would be assigned to both
> t
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
On Monday 21 March 2005 18:10, Nicholas Jacobson wrote:
> IIRC, Guido once mentioned that he regretted not
> setting function docstrings to come before the
> function declaration line, instead of after.
How do you distinguish between a docstring at the top of a module
that's immediately followed