def decorator(f):
def wrapper(*args, **kwargs):
print(f'decorator: {args} {kwargs}')
return f(*args, **kwargs)
return wrapper
def test_func(*args, **kwargs):
print(f'func {args}, {kwargs}')
@decorator
def test_func_d(*args, **kwargs):
print(f'func {args}, {kwargs}')
test_func_d(1, 2, 3, b=34, c=45)
f = decorator(test_func)
f(1, 2, 3, d=32, c=2134)
результат
decorator: (1, 2, 3) {'b': 34, 'c': 45}
func (1, 2, 3), {'b': 34, 'c': 45}
decorator: (1, 2, 3) {'d': 32, 'c': 2134}
func (1, 2, 3), {'d': 32, 'c': 2134}
print(frequency)
print(frequency())