Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 31)
31.
What is the purpose of the @contextlib.asynccontextmanager decorator?
Converts a method to a class method
Enables the use of the 'with' statement for resource management in asynchronous code
Marks a method as a static method
Decorates a method with dynamic behavior
Answer: Option
Explanation:
The @contextlib.asynccontextmanager decorator is used for creating asynchronous context managers, enabling the use of the 'async with' statement in asynchronous code.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.