A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2014-February/132634.html below:

[Python-Dev] PEP 463: Exception-catching expressions

[Python-Dev] PEP 463: Exception-catching expressions [Python-Dev] PEP 463: Exception-catching expressionsEric Snow ericsnowcurrently at gmail.com
Sat Feb 22 03:08:26 CET 2014
On Fri, Feb 21, 2014 at 6:06 PM, Jan Kaliszewski <zuo at chopin.edu.pl> wrote:
> 21.02.2014 18:37, Guido van Rossum wrote:
>
>> I'm put off by the ':' syntax myself (it looks to me as if someone
>> forgot a newline somewhere)
>
>
> As I mentioned at python-ideas I believe that parens neutralize,
> at least to some extent, that unfortunate statement-ish flavor
> of the colon.
>
> This one has some statement-like smell:
>
>     msg = seq[i] except IndexError: "nothing"
>
> But this looks better, I believe:
>
>     msg = (seq[i] except IndexError: "nothing")

Agreed.  The same holds true with {'a': 5} and function annotations
(e.g. "def f(a: 5)").

> Or even (still being my favorite):
>
>     msg = seq[i] except (IndexError: "nothing")

+1

-eric
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4