dekoratör örneği 1
This commit is contained in:
parent
8ebca951d7
commit
ef072b5018
11
python-temel/dekorator.1.py
Normal file
11
python-temel/dekorator.1.py
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
def foo(f):
|
||||||
|
print('foo')
|
||||||
|
return f
|
||||||
|
|
||||||
|
@foo
|
||||||
|
def bar():
|
||||||
|
print('bar')
|
||||||
|
|
||||||
|
# eşdeğeri -> bar = foo(bar)
|
||||||
|
|
||||||
|
bar()
|
11
python-temel/dekorator.1.py~
Normal file
11
python-temel/dekorator.1.py~
Normal file
|
@ -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
Block a user