Title: bottom-to-top decorator application order
Type: Stage:
Components: Interpreter Core Versions: Python 2.4
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon
Priority: high Keywords: patch

Created on 2004-08-15 06:39 by brett.cannon, last changed 2004-08-15 07:32 by brett.cannon. This issue is now closed.

File name Uploaded Description Edit
deco_order.diff brett.cannon, 2004-08-15 06:39 Patch to apply decorators bottom up
Messages (2)
msg46710 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-08-15 06:39
If you read
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::

  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/ to test for this order.
msg46711 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2004-08-15 07:32
Logged In: YES 

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/
      rev. 1.4
Date User Action Args
2004-08-15 06:39:58brett.cannoncreate