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