This is an example for python decorator. I am unable to understand the way it works. Please explain me the given example's control flow. I will be highly obliged.
def helloSolarSystem(original_function):
def new_function(*args, **kwargs):
original_function(*args, **kwargs)
print("Hello, solar system!")
return new_function
def helloGalaxy(original_function):
def new_function(*args, **kwargs):
original_function(*args, **kwargs)
print("Hello, galaxy!")
return new_function
@helloGalaxy
@helloSolarSystem
def hello(targetName=None):
if targetName:
print("Hello, " + targetName +"!")
else:
print("Hello, world!")
hello("Earth")