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/043501.html below:

[Python-Dev] order of decorator application?

[Python-Dev] order of decorator application? [Python-Dev] order of decorator application?ncoghlan at iinet.net.au ncoghlan at iinet.net.au
Wed Mar 24 09:12:37 EST 2004
Quoting "Phillip J. Eby" <pje at telecommunity.com>:

> At 10:24 AM 3/23/04 -0600, Skip Montanaro wrote:
> 
> >(I'm working on PEP 318...)
> >
> >
> >     def func(a,b):
> >         pass
> >     func = d2(d1(func))
> 

Another phrasing which makes L2R the 'obvious' evaluation order - don't nest 
the functions when spelling out the long form (i.e. unrolling Phillip's loop):
  def func(a,b):
    pass
  func = d1(func)
  func = d2(func)

The only way the issue is ever confused is when all the decorators are applied 
on the one line in the 'long spelling', in which case the nesting inverts the 
order of the functions. So if we refrain from ever doing that in the official 
documentation, there isn't likely to be as much confusion over the ordering.

Regards,
Nick.


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