[Python-Dev] Re: Decorator order implemented backwards?

David Eppstein eppstein at ics.uci.edu
Sun Aug 15 19:11:08 CEST 2004


In article <1092583647.1670.18.camel at localhost>,
 Mark Russell <marktrussell at btopenworld.com> wrote:

[Brett C's]
> patch results in the evaluation order:
> 
>     evalname1 evalargs1 makedec1
>     evalname2 evalargs2 makedec2
>     evalname3 evalargs3 makedec3
>     calldec3 calldec2 calldec1
> 
> Mine (#1009560) gives:
> 
>     evalname3 evalargs3 makedec3 calldec3
>     evalname2 evalargs2 makedec2 calldec2
>     evalname1 evalargs1 makedec1 calldec1

It would probably be bad style to have any order dependencies in the 
evalname evalargs makedec parts, but Brett's order makes more sense to 
me. That is, I like the actual application of decorators to be in nested 
order, but it makes more sense to me for the lines constructing the 
decorators to be evaluated in the order they appear in the code.

-- 
David Eppstein
Computer Science Dept., Univ. of California, Irvine
http://www.ics.uci.edu/~eppstein/



More information about the Python-Dev mailing list