dekoratör örneği 1
This commit is contained in:
parent
8ebca951d7
commit
ef072b5018
|
@ -0,0 +1,11 @@
|
|||
def foo(f):
|
||||
print('foo')
|
||||
return f
|
||||
|
||||
@foo
|
||||
def bar():
|
||||
print('bar')
|
||||
|
||||
# eşdeğeri -> bar = foo(bar)
|
||||
|
||||
bar()
|
|
@ -0,0 +1,11 @@
|
|||
def foo():
|
||||
print('foo')
|
||||
return f
|
||||
|
||||
@foo
|
||||
def bar():
|
||||
print('bar')
|
||||
|
||||
# eşdeğeri -> bar = foo(bar)
|
||||
|
||||
bar()
|
Loading…
Reference in New Issue