You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I realised making contextlib.redirect_stdout reentrant was actually fairly easy (thread safety is inherently impossible due to the process global side effect). Since making it reentrant makes it more user-friendly, I'll tweak the implementation to work that way.
As part of this change, the reusable-but-not-reentrant example in the docs needs to be updated to use contextlib.ExitStack rather than this (that's inherently not reentrant, since all the context managers in the stack would be triggered when the innermost context ends).
I think this change also makes for nicer examples of reentrant (using the updated redirect_stdout) and reusable-but-not-reentrant (using ExitStack) behaviour in the docs.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: