Re: [Python-Dev] docstring before function declaration

2005-03-23 Thread Nicholas Jacobson
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: How do you distinguish

Re: [Python-Dev] docstring before function declaration

2005-03-21 Thread Nicholas Jacobson
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

[Python-Dev] docstring before function declaration

2005-03-20 Thread Nicholas Jacobson
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 current method: