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