This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ncoghlan
Recipients SilentGhost, barry, mb_, ncoghlan, rhettinger, yselivanov
Date 2016-08-20.19:18:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
contextlib.suppress provides a contextmanager spelling for the following pattern:

    except <expr>:

That's a very common pattern worth having in the standard library, even though it's only a 5 line context manager.

The proposed API change would make it instead an implementation of the vastly *less* common pattern:

    except <unless-expr>:
    except <expr>:

For the use case you're discussing (trying to shut down, potentially failing, but also not wanting to hide genuine programming errors), I'd be more amenable to introducing a comparable context manager to the logging module that, instead of silently ignoring caught exceptions, logged them, and also allowed you to restrict which exceptions were logged.
Date User Action Args
2016-08-20 19:18:23ncoghlansetrecipients: + ncoghlan, barry, rhettinger, SilentGhost, yselivanov, mb_
2016-08-20 19:18:23ncoghlansetmessageid: <>
2016-08-20 19:18:23ncoghlanlinkissue27814 messages
2016-08-20 19:18:22ncoghlancreate