Python Programming - Decorators - Discussion
Discussion Forum : Decorators - General Questions (Q.No. 4)
4.
Which built-in decorator is used to enforce that a function is only called once?
Answer: Option
Explanation:
The
@functools.singledispatch
decorator is used to define a single-dispatch generic function, ensuring that the function is only called once for a particular type.
Discussion:
Be the first person to comment on this question !
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers