Browse Source

Decorator

pull/44/head
Jure Šorn 5 years ago
parent
commit
3ab544660c
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -900,7 +900,7 @@ def debug(func):
def add(x, y):
return x + y
```
* **Wraps is a helper decorator that copies metadata of function add() to function out().**
* **Wraps is a helper decorator that copies metadata of function func() to function out().**
* **Without it `'add.__name__'` would return `'out'`.**
### LRU Cache

2
index.html

@ -875,7 +875,7 @@ creature = Creature(Point(<span class="hljs-number">0</span>, <span class="hljs
<ul>
<li><strong>Wraps is a helper decorator that copies metadata of function add() to function out().</strong></li>
<li><strong>Wraps is a helper decorator that copies metadata of function func() to function out().</strong></li>
<li><strong>Without it <code class="python hljs"><span class="hljs-string">'add.__name__'</span></code> would return <code class="python hljs"><span class="hljs-string">'out'</span></code>.</strong></li>
</ul>
<div><h3 id="lrucache">LRU Cache</h3><p><strong>Decorator that caches function's return values. All function's arguments must be hashable.</strong></p><pre><code class="python language-python hljs"><span class="hljs-keyword">from</span> functools <span class="hljs-keyword">import</span> lru_cache

Loading…
Cancel
Save