args , kwargs
This commit is contained in:
parent
530cd2952e
commit
a0ee7632b0
1 changed files with 16 additions and 0 deletions
16
python-temel/args.kwargs.py
Normal file
16
python-temel/args.kwargs.py
Normal 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)
|
Loading…
Reference in a new issue