A.M. Kuchling wrote:
>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.
>
>
Yes -- my error.
>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).
>
Good point. I wonder whether we will adopt the decorator syntax for
[html] and [plain] directives as well; wasn't that a plan once upon a time?
>I like the function decorator form; excluding it, I like the
>obviousness of __doc__ = "...".
>
>
I like the function decorator form too: it suggests that the docstring
could be added in a Python-conventional way, rather than via extra
complexity in PTL compilation. That's worth delaying any decision-making
until 2.4a, IMO.
Thanks,
-- Graham