This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark_t_russell
Recipients
Date 2004-04-08.23:37:30
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
This patch implements the alternative PEP 318 syntax
that I suggested on python-dev a few days ago:

       [as classmethod]
       def func(args):
       ...

List comprehensions are not allowed, nor are empty
lists.  The newline is optional (e.g. "[as xxx] def foo"
is handled).

Two substantive changes: a moderately nasty hack
to tokeniser.c to transform LSQB "as" NAME (with
optional interspersed whitespace and comments) into
LSQB_AS NAME, and a change to Grammar from:

     funcdef: 'def' NAME parameters ':' suite

to:

    decorators: LSQB_AS test (',' test)* [','] ']'
[NEWLINE]
    funcdef: [decorators] 'def' NAME parameters ':' suite
    
plus corresponding changes to compile.c and various
other files to track the change.

Also included is an updated version of Guido's
test_decorators.py.  The rest of the test suite
passes (apart from two tests which were fail
independently of this change).
History
Date User Action Args
2007-08-23 15:37:04adminlinkissue932100 messages
2007-08-23 15:37:04admincreate