Message45724
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).
|
|
Date |
User |
Action |
Args |
2007-08-23 15:37:04 | admin | link | issue932100 messages |
2007-08-23 15:37:04 | admin | create | |
|