TypeCast/Ilyukhina_an
TypeCast/Aleksyav
f1from functools import wrapsf1from functools import wraps
22
33
t4def cast(new_type):t4def cast(t):
5    def decorator_change_type(func):5    def decorator(f):
6        @wraps(func)6        @wraps(f)
7        def change_type(*args, **kwargs):7        def newfun(*args, **kwargs):
8            return new_type(func(*args, **kwargs))8            return t(f(*args, **kwargs))
9        return change_type9        return newfun
10    return decorator_change_type10    return decorator
1111
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op