Now that we know how to write functions and call them, let’s pause for a moment and talk about what they actually are; because in Python, everything is an object—and that includes functions. They can be passed on as arguments, returned as return values, have attributes, and take part in interesting software compositions, such as the decorator design pattern.
What Maketh an Object?
We’ll talk about objects in great detail in later posts—for now, we’ll settle for the formal definition of, “um, well, a thing you can… uh, do stuff with?”. In light of this, we’ll try to understand whether Python functions qualify as objects or not.

#python #decorators #software-design #function

To Functions, and Beyond!
1.05 GEEK