Python Decorators are Easy?
Jan 7, 2022
def decorated():
print("i wish to be decorated idk why")
def decorator(decorated):
def decoration():
print("you got it!")
decorated()
decoration()decorator(decorated)
That’s life without decorators. A life where you need to call function as a parameter should be given leeway.
If only there was a way to magically combine functions decorator, decoration & decorated into one symbol while retaining functionality…..@Python
Python — Say no more
def decoration(func):
print("you got it!")
func()
@decoration
def decorated():
print("i wish to be decorated idk why")