Vladimir

24%
Flag icon
Another good use case for __call__ is implementing decorators. Decorators must be callable, and it is sometimes convenient to “remember” something between calls of the decorator (e.g., for memoization—caching the results of expensive computations for later use) or to split a complex implementation into separate methods.
Fluent Python: Clear, Concise, and Effective Programming
Rate this book
Clear rating
Open Preview