I have question about clean thory in Python. When:
@decorator_func
def func(bla, alba):
pass
Is equivalent to:
def func(bla, alba):
pass
func = decorator_func(func)
So:
@decorator_func(aaa, bar)
def func(bla, alba):
pass
Is equvalent to…?
It’s equivalent to:
Or:
So in your second example,
decorator_funcshould be a callable that returns a callable.Here’s an example of such a construction:
And another one, using only functions: