Python Programming - Decorators - Discussion
Discussion Forum : Decorators - General Questions (Q.No. 26)
26.
What is the primary purpose of the
@contextlib.contextmanager
decorator?
Answer: Option
Explanation:
The
@contextlib.contextmanager
decorator is used to define a generator-based context manager, enabling the use of the 'with' statement for resource management.
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