bar fonksiyonu parametreli

This commit is contained in:
Mert Gör 🇹🇷 2023-08-06 17:12:00 +03:00
parent 0e85044d2f
commit b4558d6ec0
No known key found for this signature in database
GPG Key ID: 2100A876D55B39B9

View 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)