Python Programming - Decorators - Discussion
Discussion Forum : Decorators - General Questions (Q.No. 12)
12.
Which decorator is commonly used for memoization in Python and can be applied to instance methods?
Answer: Option
Explanation:
The
@functools.lru_cache
decorator is commonly used for memoization, caching the results of function calls to improve performance. It can be applied to instance methods as well.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers