TypeCast/ar7is7 | TypeCast/Aleksyav | ||||
---|---|---|---|---|---|
f | 1 | from functools import wraps | f | 1 | from functools import wraps |
2 | 2 | ||||
3 | 3 | ||||
t | 4 | def cast(tp): | t | 4 | def cast(t): |
5 | def decorator(func): | 5 | def decorator(f): | ||
6 | @wraps(func) | 6 | @wraps(f) | ||
7 | def wrapper(*argv, **argc): | 7 | def newfun(*args, **kwargs): | ||
8 | return tp(func(*argv, **argc)) | 8 | return t(f(*args, **kwargs)) | ||
9 | return wrapper | 9 | return newfun | ||
10 | return decorator | 10 | return decorator | ||
11 | 11 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|