python decorators

Its very important to remember that in Python, everything is an object.

Functions are objects, classes are also objects. By virtue of being objects, they can be passed around. And they are mutable (which means they can be modified).

Think of a situation where you want to measure the time each function takes to execute. Assume you have 20 functions in your module that you want to measure the execution time for.

Continue reading “python decorators”