I am creating multiple custom decorators in python
def make_bold(func):
def core(*args, **kwargs):
func(*args, **kwargs)
print(f"running {func.__name__} for bold")
return core
def make_italic(func):
def core(*args, **kwargs):
func(*args, **kwargs)
print(f"running {func.__name__} for italic")
return core
and applying two decorators to single fucntion.
@make_bold
@make_italic
def say():
return "Hello"
when I run sah function
print(say())
prints
running say for italic
running core for bold
but it should be:
running say for italic
running say for bold
why does not get same decorated name? How can I fix it?