[Python-ideas] Fwd: Null coalescing operator
Ethan Furman
ethan at stoneleaf.us
Mon Sep 12 21:14:33 EDT 2016
On 09/12/2016 08:37 AM, Guido van Rossum wrote:
> For the record, I still really don't like PEP 463. We should strive to
> catch fewer exceptions, not make it easier to catch them.
I certainly agree with the first part, slightly reworded: we should strive to generate fewer exceptions that we have to catch.
I disagree with the second part: being able to condense four lines of code (1 for try, 1 for except, 1 for the attempt, and 1 for recovery) in to one line of code seems like a win. I know I find it frustrating when my choice is between the 4-line boiler-plate try/except, or an equally verbose and ugly multi-line non-exception generating stanza.
Anyway, my two cents worth. If you collect them all for this subject I think I owe you a dime. ;)
--
~Ethan~
More information about the Python-ideas
mailing list