Python provides a cleaner and shorter way to represent decorators by using the @
symbol.
As you can see from the example, we can use the measure_time
decorator on hello_world()
using the @
symbol. i.e @measure_time
.
An issue however, is that Python runs measure_time(hello_world)
without an explicit call, which is something we might not want.
To overcome this issue, we will use Nested Functions.