Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 8)
8.
Which decorator is used to ensure that a function is only executed after a certain condition is met?
@functools.lru_cache
@functools.wraps
@functools.singledispatch
@functools.singledispatchmethod
Answer: Option
Explanation:
There is no built-in @functools.singledispatchmethod decorator in Python, but a custom decorator can be created to execute a function based on a specified condition.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.