homepage

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 serhiy.storchaka
Recipients benjamin.peterson, ethan.furman, ncoghlan, rhettinger, serhiy.storchaka, terry.reedy
Date 2020年02月29日.06:46:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1582958796.3.0.212573522827.issue39725@roundup.psfhosted.org>
In-reply-to
Content
Because there may be more exceptions than the code writer know. The code raised OverflowError and ValueError may be in different function, so the code writer know only about ValueError, but OverflowError is an implementation detail (and may be absent in other versions).
Currently the code writer has to write the cumbersome code
 was_raised = False
 try:
 foo() # may raise ValueError -> OverflowError
 except:
 was_raised = True
 if was_raised:
 raise KeyError from None
if they want to suppress only exceptions raised in foo(). And it is worse in case of finally.
History
Date User Action Args
2020年02月29日 06:46:36serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, terry.reedy, ncoghlan, benjamin.peterson, ethan.furman
2020年02月29日 06:46:36serhiy.storchakasetmessageid: <1582958796.3.0.212573522827.issue39725@roundup.psfhosted.org>
2020年02月29日 06:46:36serhiy.storchakalinkissue39725 messages
2020年02月29日 06:46:36serhiy.storchakacreate

AltStyle によって変換されたページ (->オリジナル) /