It's weird, counterintuitive, unclear syntax to do something already handled much better by simply subclassing exceptions. I reckon that's why push-back.
On Fri, Apr 10, 2020, 8:59 AM Soni L. email@example.com wrote:
On 2020-04-10 9:40 a.m., Rhodri James wrote:
On 10/04/2020 12:43, Soni L. wrote:
it's actually fairly common to deal with KeyError instead of using dict.get or w/e.
KeyError is also raised when your code has a bug and your assumptions got broken.
it's fairly easy to get the two different KeyErrors mixed up, at least.
So don't do that, then.
why's a "help us fix bugs related to exception handling" proposal getting so much pushback? I don't understand.
this is a bigger problem in the context of massive frameworks, where you can have layers upon layers of exception handling for all sorts of different stuff. everything from catching KeyError to skip missing entries in a dictionary, in template engines, to... honestly idk what else those massive frameworks like to skip, but I regularly see ppl complaining that their framework's exception handling makes their code undebuggable. and I've been paying attention to python's IRC for years. it's a real problem. I can't be the only person who has noticed this.
sure, these language changes wouldn't magically solve that problem. but currently you can't solve the problem *at all* because there's no way to tell anything apart. the language changes would just be a step in the right direction.
opinions? bikesheds? bring it forward. don't just keep it to yourself. _______________________________________________ Python-ideas mailing list -- firstname.lastname@example.org To unsubscribe send an email to email@example.com https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://firstname.lastname@example.org/message/6SQTW5... Code of Conduct: http://python.org/psf/codeofconduct/