TypeCast/varyak | TypeCast/VladislavP | ||||
---|---|---|---|---|---|
f | 1 | from functools import wraps | f | 1 | from functools import wraps |
2 | 2 | ||||
3 | 3 | ||||
4 | def cast(t): | 4 | def cast(t): | ||
n | 5 | def decor(f): | n | 5 | def decor(func): |
6 | @wraps(f) | 6 | @wraps(func) | ||
7 | def wrapper(*args): | 7 | def wrapper(*args): | ||
t | 8 | return t(f(*args)) | t | 8 | return t(func(*args)) |
9 | return wrapper | 9 | return wrapper | ||
10 | return decor | 10 | return decor | ||
11 | 11 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|