[Patches] [ python-Patches-1009560 ] Fix @decorator evaluation order

SourceForge.net noreply at sourceforge.net
Sun Aug 15 21:42:06 CEST 2004


Patches item #1009560, was opened at 2004-08-15 15:07
Message generated for change (Comment added) made by mark_t_russell
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1009560&group_id=5470

Category: Parser/Compiler
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Mark Russell (mark_t_russell)
Assigned to: Nobody/Anonymous (nobody)
Summary: Fix @decorator evaluation order

Initial Comment:
This patch fixes decorator evaluation order
and makes newlines between decorators
mandatory.

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)

The order of evaluation issue is slightly
more subtle than it first appears - there
are two orders involved:

    - evaluation of decorator expressions
    - evaluation of the returned decorators

This patch arranges for the evaluation order
to be exactly the same as you get with the
manual way of writing decorators, which I
think is the least surprising way of doing
things.


----------------------------------------------------------------------

>Comment By: Mark Russell (mark_t_russell)
Date: 2004-08-15 19:42

Message:
Logged In: YES 
user_id=1017234

Used Brett's evaluation order (see
http://mail.python.org/pipermail/python-dev/2004-August/047835.html)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1009560&group_id=5470


More information about the Patches mailing list