args , kwargs

This commit is contained in:
Mert Gör 🇹🇷 2023-08-05 16:44:23 +03:00
parent 530cd2952e
commit a0ee7632b0
No known key found for this signature in database
GPG key ID: 2100A876D55B39B9

View file

@ -0,0 +1,16 @@
class foo:
def __init__(self, f):
self.f = f
def __call__(self, *args, **kwargs):
print('araya giren kod')
self.f(*args, **kwargs)
@foo
def bar(a, b, c):
print(f'foo: {a}, {b}, {c}')
# foo = bar(foo)
bar(1, 2, 3)
bar(4, 5, 6)