<li><strong>Wraps is a helper decorator that copies the metadata of a passed function (func) to the function it is wrapping (out).</strong></li>
<li><strong>Wraps is a helper decorator that copies the metadata of the passed function (func) to the function it is wrapping (out).</strong></li>
<li><strong>Without it <codeclass="python hljs"><spanclass="hljs-string">'add.__name__'</span></code> would return <codeclass="python hljs"><spanclass="hljs-string">'out'</span></code>.</strong></li>
<li><strong>Without it <codeclass="python hljs"><spanclass="hljs-string">'add.__name__'</span></code> would return <codeclass="python hljs"><spanclass="hljs-string">'out'</span></code>.</strong></li>
</ul>
</ul>
<div><h3id="lrucache">LRU Cache</h3><p><strong>Decorator that caches function's return values. All function's arguments must be hashable.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> functools <spanclass="hljs-keyword">import</span> lru_cache
<div><h3id="lrucache">LRU Cache</h3><p><strong>Decorator that caches function's return values. All function's arguments must be hashable.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> functools <spanclass="hljs-keyword">import</span> lru_cache
<li><strong>Recursion depth is limited to 1000 by default. To increase it use <codeclass="python hljs"><spanclass="hljs-string">'sys.setrecursionlimit(<depth>)'</span></code>.</strong></li>
<li><strong>In CPython recursion depth is limited to 1000 by default. To increase it use <codeclass="python hljs"><spanclass="hljs-string">'sys.setrecursionlimit(<depth>)'</span></code>.</strong></li>
</ul>
</ul>
<div><h3id="parametrizeddecorator">Parametrized Decorator</h3><p><strong>A decorator that accepts arguments and returns a normal decorator that accepts a function.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> functools <spanclass="hljs-keyword">import</span> wraps
<div><h3id="parametrizeddecorator">Parametrized Decorator</h3><p><strong>A decorator that accepts arguments and returns a normal decorator that accepts a function.</strong></p><pre><codeclass="python language-python hljs"><spanclass="hljs-keyword">from</span> functools <spanclass="hljs-keyword">import</span> wraps