Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 19)
19.
What is the purpose of the @functools.lru_cache decorator's typed parameter?
It enforces strong typing for the cached values.
It uses a different cache for each data type.
It enables caching for functions with different argument types.
It specifies the maximum size of the cache.
Answer: Option
Explanation:
The @functools.lru_cache decorator's typed parameter, when set to True, uses a different cache for each distinct data type, preventing collisions between values of different types.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.