[Python-Dev] docstring before function declaration
nicksjacobson at yahoo.com
Tue Mar 22 19:42:52 CET 2005
Oops, you're right.
What I should have said is to use an empty docstring
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 <anthony at interlink.com.au> wrote:
> On Monday 21 March 2005 20:08, Nicholas Jacobson
> > > How do you distinguish between a docstring at
> > > top of a module
> > > that's immediately followed by a function? Is
> > > the module docstring
> > > or the function docstring?
> > It's both. The docstring would be assigned to
> > the module and the function. This is a *good*
> > when there is a module with only one function in
> > i.e. there should only be one docstring for both,
> > this saves repetition of that docstring.
> > If a programmer wanted a docstring for the
> > but not the module, a blank first line would do
> > trick. A docstring for the module but not the
> > function? Put a blank line between the module's
> > docstring and the function.
> Yuk. This is magic taken to a ridiculous level. Note
> "blank lines" currently have no meaning in Python,
> and adding
> a meaning to them is not my idea of a good thing.
> Anthony Baxter <anthony at interlink.com.au>
> It's never too late to have a happy childhood.
Do you Yahoo!?
Yahoo! Small Business - Try our new resources site!
More information about the Python-Dev