You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
**Decorator that prints function's name every time it gets called. Wraps is a helper decorator that copies metadata of function add() to function out(). Without it `'add.__name__'` would return `'out'`.**
611
+
**Decorator that prints function's name every time it gets called.**
612
612
613
613
```python
614
614
from functools import wraps
@@ -624,6 +624,8 @@ def debug(func):
624
624
defadd(x, y):
625
625
return x + y
626
626
```
627
+
***Wraps is a helper decorator that copies metadata of function add() to function out().**
628
+
***Without it `'add.__name__'` would return `'out'`.**
627
629
628
630
### LRU Cache
629
631
**Decorator that caches function's return values. All arguments must be hashable.**
@@ -714,7 +716,9 @@ class MyComparable:
714
716
```
715
717
716
718
### Hashable
717
-
**Hashable object needs both hash() and eq() methods and it's hash value should never change. Objects that compare equal must have the same hash value, meaning default hash() that returns `'id(self)'` will not do. That is why Python automatically makes classes unhashable if you only implement eq().**
719
+
***Hashable object needs both hash() and eq() methods and it's hash value should never change.**
720
+
***Objects that compare equal must have the same hash value, meaning default hash() that returns `'id(self)'` will not do.**
721
+
***That is why Python automatically makes classes unhashable if you only implement eq().**
0 commit comments