Ким Ренат, 407 группа FuncCount 7953
Aleksey FuncCount 8091
f1from functools import wrapsf1from functools import wraps
22
n3def counter(f):n3def counter(func):
4    count = 04    count = 0
55
n6    @wraps(f)n6    @wraps(func)
7    def new_f(*args, **kwargs):7    def wrapper(*args, **kwargs):
8        nonlocal count8        nonlocal count
9        count += 19        count += 1
n10        return f(*args, **kwargs)n10        return func(*args, **kwargs)
1111
n12    def get_count():n12    def counter_method():
13        return count13        return count
t14    new_f.counter = get_countt14    wrapper.counter = counter_method
15    return new_f15    return wrapper
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op