Стасев Станислав 511, ВМК FuncCount 7951
Mikhailenko Alexandr Sergeevich 316 FuncCount 7539
f1from functools import wrapsf1from functools import wraps
22
3def counter(func):3def counter(func):
4    calls = 04    calls = 0
55
6    @wraps(func)6    @wraps(func)
7    def wrapper(*args, **kwargs):7    def wrapper(*args, **kwargs):
8        nonlocal calls8        nonlocal calls
9        calls += 19        calls += 1
10        return func(*args, **kwargs)10        return func(*args, **kwargs)
1111
n12    def get_count():n12    def get_calls():
13        return calls13        return calls
t14    wrapper.counter = get_countt14    wrapper.counter = get_calls
15    return wrapper15    return wrapper
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op