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

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

[Python-Dev] PEP 463: Exception-catching expressions [Python-Dev] PEP 463: Exception-catching expressionsTim Delaney timothy.c.delaney at gmail.com
Sat Feb 22 01:56:08 CET 2014
On 22 February 2014 10:29, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:

> Antoine Pitrou wrote:
>
>     lst = [1, 2]
>>>    value = lst[2] except IndexError: "No value"
>>>
>>
>> the gain in concision is counterbalanced by a loss in
>> readability,
>>
>
> This version might be more readable:
>
>    value = lst[2] except "No value" if IndexError
>

+1 - it's readable, clear, and only uses existing keywords.

Tim Delaney
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20140222/5d381c79/attachment.html>
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