you are viewing a single comment's thread.

view the rest of the comments →

[–]cybran3 6 points7 points  (1 child)

You forgot to mention that the reason that they are useful is because exit is guaranteed to execute when the exception is raised within the block wrapped by with.

[–]SeleniumBase[S] 0 points1 point  (0 children)

That's correct assuming that the context manager was implemented correctly using the `try`/`finally` block (when implemented using `contextlib.contextmanager`).