If you need to manage multiple resources simultaneously, the contextlib module provides a utility named _______ to nest context managers.

  • ExitStack
  • context_manager
  • context_stack
  • nested_context
The contextlib module provides a utility named ExitStack for nesting context managers. It allows you to manage multiple resources simultaneously by entering and exiting them in a stacked manner, ensuring proper cleanup.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *