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

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

[Python-Dev] PEP 463: Exception-catching expressions [Python-Dev] PEP 463: Exception-catching expressionsJan Kaliszewski zuo at chopin.edu.pl
Mon Feb 24 01:36:46 CET 2014
23.02.2014 19:51, Stefan Behnel wrote:

> I see a risk of interfering with in-place assignment operators, e.g.
>
>     x /= y except ZeroDivisionError: 1
>
> might not do what one could expect, because (as I assume) it would 
> behave
> differently from
>
>     x = x / y except ZeroDivisionError: 1
[snip]

Please note that:

     x /= y if y else 0

also behaves differently from

     x = x / y if y else 0

Anyway, enclosing in parens would make that expicit and clear.

Cheers.
*j

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