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/132628.html below:

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

[Python-Dev] PEP 463: Exception-catching expressions [Python-Dev] PEP 463: Exception-catching expressionsGreg Ewing greg.ewing at canterbury.ac.nz
Sat Feb 22 02:41:20 CET 2014
Ethan Furman wrote:
> On 02/21/2014 03:29 PM, Greg Ewing wrote:
> 
>>     value = lst[2] except "No value" if IndexError
> 
> It does read nicely, and is fine for the single, non-nested, case (which 
> is probably the vast majority), but how would it handle nested exceptions?

Hmmm, probably not very well, unless we define

    a except b if E1 except c if E2

to mean

    a except (b except c if E2) if E1

If E1 == E2, that could perhaps be abbreviated to

    a except b except c if E

Or we could just decide that the nested case is going
to be so rare it's not worth worrying about.

-- 
Greg
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