TypeCast/Vlad97 | TypeCast/JuliaZ | ||||
---|---|---|---|---|---|
f | 1 | from functools import wraps | f | 1 | from functools import wraps |
2 | 2 | ||||
3 | 3 | ||||
n | 4 | def cast(f): | n | 4 | def cast(type): |
5 | def decor(fun): | 5 | def functional(func): | ||
6 | @wraps(fun) | 6 | @wraps(func) | ||
7 | def newfun(*args): | 7 | def argument(*args): | ||
8 | return f(fun(*args)) | 8 | return type(func(*args)) | ||
9 | return newfun | ||||
10 | return decor | ||||
11 | 9 | ||||
t | t | 10 | return argument | ||
11 | |||||
12 | return functional | ||||
13 |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|