Python Developer — Hard
Key points
- `__call__` enables instances of a class to be called like functions
- It is used for creating callable objects and class-based decorators
- The method is executed when the instance is called with ()
- Objects implementing __call__ can retain state between calls
Ready to go further?
Related questions
