On Tuesday, June 28, 2016 at 5:03:08 PM UTC+12, Ben Finney wrote:
>     decorator_with_args = lambda decorator: lambda *args, **kwargs: lambda 
> func: decorator(func, *args, **kwargs)
Ah, I see why there are 3 lambdas, instead of 2. It’s so that you can write

    decorator_func = decorator_with_args(actual_func)

then you can use it like this:

    @decorator_func(...additional args for actual_func...)
    def some_func...

to invoke actual_func(some_func, ... additional args for actual_func...) on 
some_func, and assign the result back to some_func.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to