Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 23)
23.
What does the @functools.cached_property decorator do when applied to a method inside a class?
Converts the method to a class method
Marks the method as a static method
Caches the result of the method and returns the cached value
Decorates the method with dynamic behavior
Answer: Option
Explanation:
The @functools.cached_property decorator caches the result of a method and returns the cached value on subsequent calls.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.