Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 28)
28.
What is the primary purpose of the @functools.cached_property decorator?
Caches the results of function calls to improve performance
Converts a method to a class method
Declares an abstract method in a Python class
Marks a method as a static method
Answer: Option
Explanation:
The @functools.cached_property decorator is used to cache the result of a method and return the cached value on subsequent calls, improving performance by avoiding redundant computations.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.