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

[Python-Dev] Decorator PEP elaborations

[Python-Dev] Decorator PEP elaborations [Python-Dev] Decorator PEP elaborationsGuido van Rossum gvanrossum at gmail.com
Tue Sep 14 02:12:55 CEST 2004
No PEP text from me, but:

> If one of the authors gets a chance, it would be nice to document the
> rationale for the order of application being inside-out instead of
> top-down:
> 
>     @deco3
>     @deco2
>     @deco1
>     def myfunc(args):
>         . . .

This is the usual order for function-application. @f @g def foo() ->
foo=f(g(foo).

> Also, it would be nice to document the reasons for the approach to
> argument handling:
> 
>     @deco             # calls deco(f)
>     @decomaker(arg)   # calls tmp(f) where tmp=decomaker(arg)

The thing after the @ can be consered to be an expression (never mind
that syntactically you are restricted), and whatever that expression
returns is called.

-- 
--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