Yet another decorator proposal
Anthony Baxter
anthonybaxter at gmail.com
Fri Aug 13 03:19:47 EDT 2004
On Wed, 11 Aug 2004 08:06:33 +0200, Marco Aschwanden
<ppntwimbxffc at spammotel.com> wrote:
>
> Here is yet another decorator proposal:
>
> def sumSequencesLengths(var1, var2):
> """Computes something very important.
>
> __decorators__:
> staticmethod
> __parameters__:
> var1=Sequences
> var2=Sequences
> __returns__:
> int
> """
Sorry - you're putting the decorators _inside_ the docstring? Why on
earth would you want to do that? In the god-knows-how-many years
we've had docstrings, we can't even agree on a common way to mark
these up, let alone attaching magic to their meanings...!
Note also that one of the advantages of adding decorators is that
it offers a cleaner solution for things like SPARK that currently put
parse rules inside a docstring. There's a bunch of other nasties
like that - e.g. Zope originally used the presence or absence of
a doc string to mean "public" or "private".
Anthony
More information about the Python-list
mailing list