Python Programming - Decorators - Discussion
Discussion Forum : Decorators - General Questions (Q.No. 2)
2.
Which of the following decorators is used to cache the result of a function to improve performance?
Answer: Option
Explanation:
The
@functools.lru_cache
decorator is used to cache the result of a function with the least recently used (LRU) strategy, improving the performance by avoiding redundant calculations.
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