Alternative decorator syntax decision

Peter Otten __peter__ at web.de
Fri Aug 20 04:28:32 EDT 2004


Paul Rubin wrote:

> "Paul McGuire" <ptmcg at austin.rr._bogus_.com> writes:
>> I would propose a multivote survey: each poster gets 3 votes among the
>> lettered choices on the Wiki page above.  You can use all 3 for a single
>> option, or split them across 2 or 3 options if you are open to more than
>> one.
> 
> 1. My favorite variant was not in the list.

I suggest that you add it.
 
> 2. Any of the choices will have far reaching consequences that aren't
>    yet thought out very well.  There is not yet enough experience
>    programming with the existing mechanisms (classmethods etc.) to
>    be sure what's really worthwhile.

The PyObjC and (some?) Zope people say they need "fancy" decorators badly.
Classmethods are comparatively straight-forward.
 
> 3. There's not all that much discussion on the wiki of how other
>    languages do this stuff.

I think Java and C# have been discussed on python-dev. Again you could share
your experience.
 
> 4. There's nowhere near consensus that any of the choices presented so
>    far are not plain horrible.
> 
> My conclusion: Python 2.4 should not have new decorator syntax.  Stay
> with the existing stuff, for now.

D'accord. The most promising way to achieve that is to collect arguments
against the pie that can convince Guido and find a contender that has at
least the same level of support in the community.
On a side note, I think it strange that aesthetics are ruled out. Certainly
neither the decorator suite nore the pies can be advertised as "executable
pseudocode".

> Discussion and exploration should continue and the question should be
> revisited for 2.5.  For 2.4, extend the current kludgy (decorators
> separated from the function) mechanism if needed to provide necessary
> functionality, but deprecate any new such feature as soon as it's
> introduced, with the explanation that it's exploratory.

Those who need decorators will adopt the included syntax even if it is not
their favourite. I guess that unless technical problems appear yours will
be an effective vote for the @decorator.

Peter





More information about the Python-list mailing list