bar fonksiyonu parametreli
This commit is contained in:
parent
0e85044d2f
commit
b4558d6ec0
1 changed files with 18 additions and 0 deletions
18
python-temel/bar.fonksiyonu.parametreli.py
Normal file
18
python-temel/bar.fonksiyonu.parametreli.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
def foo(c):
|
||||
def g(*args, **kwargs):
|
||||
print('g')
|
||||
return c(*args, **kwargs)
|
||||
return g
|
||||
|
||||
@foo
|
||||
class Sample:
|
||||
def __init__(self, a, b):
|
||||
print('Sample instance created')
|
||||
self.a = a
|
||||
self.b = b
|
||||
|
||||
# Sample = foo(Sample)
|
||||
|
||||
s = Sample(10, 20)
|
||||
|
||||
print(s.a, s.b)
|
Loading…
Reference in a new issue