class callable:
def __init__(self, func):
self.func = func
def __call__(self, *args):
print(args)
return self.func(*args)
myfunc = callable(lambda x: x + 1)
@callable
def f(a, b):
return a + b
print(myfunc(1))
print(f(1, 2))
print(f('a', 'b'))
Y2xhc3MgY2FsbGFibGU6CiAgICBkZWYgX19pbml0X18oc2VsZiwgZnVuYyk6CiAgICAgICAgc2VsZi5mdW5jID0gZnVuYwoKICAgIGRlZiBfX2NhbGxfXyhzZWxmLCAqYXJncyk6CiAgICAgICAgcHJpbnQoYXJncykKICAgICAgICByZXR1cm4gc2VsZi5mdW5jKCphcmdzKQoKCm15ZnVuYyA9IGNhbGxhYmxlKGxhbWJkYSB4OiB4ICsgMSkKCkBjYWxsYWJsZQpkZWYgZihhLCBiKToKICAgIHJldHVybiBhICsgYgoKcHJpbnQobXlmdW5jKDEpKQpwcmludChmKDEsIDIpKQpwcmludChmKCdhJywgJ2InKSkK