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 Jim.Jewett, Trundle, Yury.Selivanov, barry, benjamin.peterson, cvrebert, daniel.urban, eric.araujo, ethan.furman, gcbirzan, gvanrossum, jamesh, ncoghlan, pitrou, yorik.sar
Date 2013-10-26.08:28:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Because context managers are closer to try/finally blocks than they are to exception handling, the class-based implementation for the contextlib.suppress API uses issubclass rather than emulating the CPython exception handling semantics:

The exception checking in the unittest module is similarly based on issubclass:

I'm planning to add the catch() and ExitLabel() context managers to contextlib2 this evening, and those too will be based on issubclass().

Perhaps as a near term thing, we should put an "implementation detail" notice somewhere in the language reference, pointing that it's the code using issubclass that is considered correct here, and CPython's exception handling that is considered out of line?
Date User Action Args
2013-10-26 08:28:10ncoghlansetrecipients: + ncoghlan, gvanrossum, barry, jamesh, pitrou, benjamin.peterson, eric.araujo, Trundle, cvrebert, daniel.urban, yorik.sar, ethan.furman, Yury.Selivanov, Jim.Jewett, gcbirzan
2013-10-26 08:28:09ncoghlansetmessageid: <>
2013-10-26 08:28:09ncoghlanlinkissue12029 messages
2013-10-26 08:28:09ncoghlancreate