| TypeCast/yura-leb | TypeCast/Aleksyav | ||||
|---|---|---|---|---|---|
| f | 1 | from functools import wraps | f | 1 | from functools import wraps |
| 2 | 2 | ||||
| 3 | 3 | ||||
| n | 4 | def cast(typ): | n | 4 | def cast(t): |
| 5 | def decor(fun): | 5 | def decorator(f): | ||
| 6 | @wraps(fun) | 6 | @wraps(f) | ||
| 7 | def newfun(*args, **kwargs): | 7 | def newfun(*args, **kwargs): | ||
| n | 8 | return typ(fun(*args, **kwargs)) | n | 8 | return t(f(*args, **kwargs)) |
| 9 | return newfun | 9 | return newfun | ||
| t | 10 | return decor | t | 10 | return decorator |
| 11 | 11 | ||||
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||