A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-March/043412.html below:

[Python-Dev] order of decorator application?

[Python-Dev] order of decorator application? [Python-Dev] order of decorator application?Guido van Rossum guido at python.org
Tue Mar 23 11:28:33 EST 2004
> (I'm working on PEP 318...)
> 
> Is there a concensus on the order of application for decorators?  Should
> 
>     def func(a,b) [d1,d2]:
>         pass
> 
> be equivalent to
> 
>     def func(a,b):
>         pass
>     func = d1(d2(func))
> 
> or
> 
>     def func(a,b):
>         pass
>     func = d2(d1(func))
> 
> or is it a coin toss?  I'm having trouble finding coherent discussion on
> this topic in the archives.  Pointers appreciated.

I think the consensus was d2(d1(func)).  I.e. application from left to
right -- just like all lists are evaluated L2R in Python.

--Guido van Rossum (home page: http://www.python.org/~guido/)

More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4