durusmail: quixote-users: Documenting PTL
Documenting PTL
2004-07-05
2004-07-05
2004-07-06
2004-07-06
Re: Documenting PTL
2004-07-06
Documenting PTL
A.M. Kuchling
2004-07-06
On Mon, Jul 05, 2004 at 11:26:01AM -0400, Graham Fawcett wrote:
> def backticks [html] (request):
>     ```
>     Correct Python (sort of), and easy to read.
>     I wish python-mode would recognize it, though...
>     But it risks invoking eval() on a docstring if it is coppied
>     into a normal Python function...

I think you mean repr() instead of eval() in that comment.  There's no
risk to invoking repr(), beyond losing a little CPU time.

> """
> A Javadoc style;
> stick the docstring above the function.
> """
> def javadoc_style [html] (request):
>     ....

There's also Python 2.4's hypothetical function decorator syntax (but
Guido hasn't decided on the syntax yet):

@doc("""href() -- create link...""")
def href [html] (blah):
    ...

Or maybe it'll be:

[doc("""href() -- create link...""")]
def href [html] (blah):
    ...

We might want to wait until 2.4alpha2 to find out which syntax is
chosen (alpha1 isn't out yet, so alpha2 will probably be in 2-3
months).  I like the function decorator form; excluding it, I like the
obviousness of __doc__ = "...".

--amk

reply