diff options
author | Michael W. Hudson <mwh@python.net> | 2004-08-17 17:29:16 (GMT) |
---|---|---|
committer | Michael W. Hudson <mwh@python.net> | 2004-08-17 17:29:16 (GMT) |
commit | 0ccff074cd806bc7e963a1e0ff6ce25e0d11cce9 (patch) | |
tree | c8e7be65d3051aa878fe53169b9bdeb4d3b4227e /Grammar | |
parent | b51b23405b6cf82ab4ec20f3d5ef4b895bd0786f (diff) | |
download | cpython-0ccff074cd806bc7e963a1e0ff6ce25e0d11cce9.zip cpython-0ccff074cd806bc7e963a1e0ff6ce25e0d11cce9.tar.gz cpython-0ccff074cd806bc7e963a1e0ff6ce25e0d11cce9.tar.bz2 |
This is Mark Russell's patch:
[ 1009560 ] Fix @decorator evaluation order
From the description:
Changes in this patch:
- Change Grammar/Grammar to require
newlines between adjacent decorators.
- Fix order of evaluation of decorators
in the C (compile.c) and python
(Lib/compiler/pycodegen.py) compilers
- Add better order of evaluation check
to test_decorators.py (test_eval_order)
- Update the decorator documentation in
the reference manual (improve description
of evaluation order and update syntax
description)
and the comment:
Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)
(I'm checking this in for Anthony who was having problems getting SF to
talk to him)
Diffstat (limited to 'Grammar')
-rw-r--r-- | Grammar/Grammar | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Grammar/Grammar b/Grammar/Grammar index 111ebe0..8a7eb59 100644 --- a/Grammar/Grammar +++ b/Grammar/Grammar @@ -28,8 +28,8 @@ single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE file_input: (NEWLINE | stmt)* ENDMARKER eval_input: testlist NEWLINE* ENDMARKER -decorator: '@' dotted_name [ '(' [arglist] ')' ] -decorators: decorator ([NEWLINE] decorator)* NEWLINE +decorator: '@' dotted_name [ '(' [arglist] ')' ] NEWLINE +decorators: decorator+ funcdef: [decorators] 'def' NAME parameters ':' suite parameters: '(' [varargslist] ')' varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' '**' NAME] | '**' NAME) | fpdef ['=' test] (',' fpdef ['=' test])* [','] |