PyDocs

Nav

Python Runtime Services

ExitStack.push

  • ExitStack.push(exit)
Registers a callback with the standard __exit__ method signature.

Can suppress exceptions the same way __exit__ method can.
Also accepts any object with an __exit__ method (registering a call
to the method instead of the object itself).
Changed in 3.15
  • 3.15: Added support for arbitrary descriptors __exit__().
0 Examples
No examples for contextlib/ExitStack.push.
See Also
No see-alsos for contextlib/ExitStack.push
0 Notes
No notes for ExitStack.push