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?
@staticmethod
@functools.lru_cache
@classmethod
@property
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:

Your comments will be displayed after verification.