Q re documentation Python style

Paddy paddy3118 at googlemail.com
Sun Jun 8 20:00:24 EDT 2008


On Jun 8, 10:17 pm, kj <so... at 987jk.com.invalid> wrote:
> I'm a Perlhead trying to learn the Way of Python.  I like Python
> overall, but every once in a while I find myself trying to figure
> out why Python does some things the way it does.  At the moment
> I'm scratching my head over Python's docstrings.  As far as I
> understand this is the standard way to document Python code.  I
> think that's fine for simple functions, but I have some functions
> that require a very long docstring to document, and somehow I find
> it a bit disconcerting to stick a few screenfuls of text between
> the top line of a function definition and its body.
Hi Kynn,
Strings on their own are also valid statements so if in Perl you might
documentbefore the sub statement or even after the function definition
then you could put extra information in a tripple quoted string
statement before your function and put the bare essentials in the
function itself. This would leave the def nearer the body of the
function, but I don't know of anyone else that does this.

- Paddy.




More information about the Python-list mailing list