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

SourceForge.net noreply at sourceforge.net
Sun Aug 15 09:32:23 CEST 2004


Patches item #1009444, was opened at 2004-08-14 23:39
Message generated for change (Comment added) made by bcannon
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: Closed
>Resolution: Fixed
Priority: 7
Submitted By: Brett Cannon (bcannon)
>Assigned to: Brett Cannon (bcannon)
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.

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

>Comment By: Brett Cannon (bcannon)
Date: 2004-08-15 00:32

Message:
Logged In: YES 
user_id=357491

Well, I went ahead and applied the patch figuring it was just so simple 
and the tests passed it was silly to wait for people to check a two line 
change in Python/compile.c .

Applied as:
* Python/compile.c
      rev. 2.318
* Lib/test/test_decorators.py
      rev. 1.4

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

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