Alternative decorator syntax decision

Jess Austin jess.austin at gmail.com
Tue Aug 24 15:45:06 EDT 2004


hi,

I vote:

J2, J2, J2

and thus the split-vote mechanism is completely defeated.  I don't
think you can enforce 2nd-choice voting on a newsgroup.  I find suite
expansion to be far more pythonic than anything else we've come up
with.

Just to be clear, the following is J2:

Nicolas Fleury <nid_oizo at yahoo.com_removethe_> wrote in message news:<w0iVc.23881$Mt5.1145911 at wagner.videotron.net>...
> Proposal 1:
> 
> decorate: staticmethod
> def foo(a, b):
>      ...
> 
> decorate:
>      accepts(int,int)
>      returns(float)
> def bar(low, high):
>      ...
> 
> other possible keywords: predef, from, as, with

while this is E4, which I think has some traits that Guido has already
vetoed in http://mail.python.org/pipermail/python-dev/2004-August/047279.html:

> Proposal 2:
> 
> def foo(a,b):
>      using staticmethod
>      ...
> 
> def bar(low, high):
>      using accepts(int, int)
>      using returns(float)
> 
> other possible keywords: decorate, transform, with, postdef, as

[snip]

> What keywords would you prefer?  Do you see any that I have not listed?

I like "decorate" much better than "transform", because "transform"
encompasses more than the specific concept of decoration.  If there is
a concern that decoration is a larger concept than what is proposed in
PEP 318, then I would consider some other, more specific verb.

Verb it must be, though, as opposed to something adverbial or
prepositional or even gerundy.  It seems to have been made quite clear
that decoration is a separate action from definition.  If we use a
word that isn't another transitive verb, that word will attach itself
to "def" and the syntax will obscur the semantics.

> Do you think there's an alternative that I should have listed, even 
> considering what have been ruled out by Guido?

Solutions that are already or obviously will be rejected by Guido
contribute to noise levels.  b-)



More information about the Python-list mailing list