Decorators
Updated Nov 07, 2019 ·
Functions as Objects
In Python, functions are just another type of object. You can treat them like numbers, strings, lists, or dictionaries.
- Functions can be assigned to variables
- Functions can be stored in lists or dictionaries
- Functions can be passed as arguments or returned from other functions
Because functions are objects, you can store them, pass them around, or manipulate them like any other value.
For more information, please see Functions as Objects.