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
A small lib improvement suggestion could be to make contextlib.redirect_stdout and contextlib.suppress inherit from ContextDecorator.
As a side note, the source of contextlib has some classes inheriting explicitly from object while others don't, so perhaps this can be harmonized at the same time.
Aye, suppress is only intended for use around a single line of code. Using it for an entire function would be "OnError Resume Next" levels of poor coding style.
I'm also -1 on implicitly wrapping redirect_stdout around functions due to the immediate thread safety problem doing so introduces. The stdout redirection really only makes sense in a single-threaded scripting context, and using it as a decorator rather than inline makes it far too easy to inadvertently violate that constraint.
As far as the "explicitly inherit from object or not" goes, it wouldn't surprise me if that's just a "migrated from Python 2" vs "first introduced in Python 3" distinction. It's not something I would change solely for the sake of consistency.
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: