Python Decorators in 12 Steps (2012)
Maybe writing lots of decorators helps you applying this concept when you need to solve some sort of complex problems. However, I fail to understand the usefulnesses of the examples given in all the tutorials I read about decorators. Sure, it helps to D.R.Y when you want to log something or deal with authentication. Yet I find they infringe the "explicit is better than implicit" rule.<p>When I read code not written by myself and see this:<p>@something<p>def foo(bar):<p>...<p>It is not immediately clear to me what foo actually does whereas<p>def foo(bar):<p># some function calls here<p># next: what foo does with these results<p># some more function calls on what has been done before<p>gives me a hint without scrolling through the code.