[Patches] [ python-Patches-1009444 ] bottom-to-top decorator application order

SourceForge.net noreply at sourceforge.net
Sun Aug 15 08:39:58 CEST 2004


Patches item #1009444, was opened at 2004-08-14 23:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1009444&group_id=5470

Category: Core (C code)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 7
Submitted By: Brett Cannon (bcannon)
Assigned to: Nobody/Anonymous (nobody)
Summary: bottom-to-top decorator application order

Initial Comment:
If you read http://mail.python.org/pipermail/python-dev/2004-
August/047512.html you will find out that Guido meant for the 
application order to go bottom-to-top (or right-recursive if you 
think of it as being in a list).  That means that::

  @first
  @second
  def blah(): pass

will end up doing::

  blah = first(second(blah))

The attached patch fixes Python/compile.c to follow this order and 
changes Lib/test/test_decorators.py to test for this order.

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

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


More information about the Patches mailing list