
On Fri, Apr 8, 2011 at 10:13 AM, Nick Coghlan <ncoghlan@gmail.com> wrote:
On Sat, Apr 9, 2011 at 12:04 AM, Mike Graham <mikegraham@gmail.com> wrote:
Neither of these seem justified for a rare case (this sort of patter is fairly rare, most notably this one example) when there's nothing that awful about the current solution.
Actually, there is an awful lot of code in the wild that gives incorrect and wildly misleading error messages *because* correctly checking the errno attribute is so rare. PEP 3151 would improve the quality of information provided by a lot of tracebacks and error messages without many of those developers needing to even set finger to keyboard.
But Nick, that's different from what I'm saying is rare. I'm saying that the situation where we need an if->raise on a constant parameter is rare (this being almost the only common case). The issue of whether people handle that case being rare is separate. Neither the "except Foo as e if f(e):" syntax nor the "except foo(some_errno):" pattern propose something that stops people from doing stupid stuff like "except IOError" with no check. Mike