Татьяна Точаева, 321 группа FuncCount 8105
Dimitry FuncCount 7834
f1from functools import wrapsf1from functools import wraps
22
3def counter(func):3def counter(func):
44
5    @wraps(func)5    @wraps(func)
6    def wrapper(*args, **kwargs):6    def wrapper(*args, **kwargs):
n7        wrapper.count += 1n7        wrapper._count += 1
8        return func(*args, **kwargs)8        return func(*args, **kwargs)
n9    wrapper.count = 0n9    wrapper._count = 0
1010
t11    def counter_method():t11    def get_count():
12        return wrapper.count12        return wrapper._count
13    wrapper.counter = counter_method13    wrapper.counter = get_count
14    return wrapper14    return wrapper
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op