TypeCast/antonnikvl
TypeCast/Aleksyav
f1from functools import wrapsf1from functools import wraps
22
33
n4def cast(type):n4def cast(t):
5    def dec(func):5    def decorator(f):
6        @wraps(func)6        @wraps(f)
7        def newfun(*args, **kwargs):7        def newfun(*args, **kwargs):
n8            return type(func(*args, **kwargs))n8            return t(f(*args, **kwargs))
9        return newfun9        return newfun
t10    return dect10    return decorator
1111
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op