Function assignment


Before we learn about decorators let's remember that we can assign function names to other names and then use the new name:

examples/decorators/function_assignment.py
def hello(name):
    print(f"Hello {name}")

hello("Python")
print(hello)

greet = hello
greet("Python")
print(greet)

Hello Python
<function hello at 0x7f8aee3401f0>
Hello Python
<function hello at 0x7f8aee3401f0>