Python Programming - Decorators - Discussion

Discussion Forum : Decorators - General Questions (Q.No. 35)
35.
What is the primary use case for the @contextlib.redirect_stdout decorator?
Converts a method to a class method
Redirects standard output to a specified file or file-like object
Marks a method as a static method
Decorates a method with dynamic behavior
Answer: Option
Explanation:
The @contextlib.redirect_stdout decorator is used to redirect standard output to a specified file or file-like object within a context.
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.