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/2018-July/154512.html below:

[Python-Dev] Call for prudence about PEP-572

[Python-Dev] Call for prudence about PEP-572 [Python-Dev] Call for prudence about PEP-572Eric V. Smith eric at trueblade.com
Sun Jul 8 07:03:32 EDT 2018
On 7/8/2018 5:41 AM, Giampaolo Rodola' wrote:
> As for "assert" what I'm concern about is the proliferation of things 
> like this:
>      class Foo:
>          def __init__(self):
>              assert self.x := fun1()
>              assert self.y := fun2()
>              assert self.z := fun3()
> 
> When I look at that my brain tells me that the main subject of the line 
> is "assert", not the assignment, but maybe it's just because I'm not 
> used to it. That aside there's the question of what to do when "python 
> -O" switch is used. With this in place "-O" would acquire a new meaning, 
> as it would disable "assert" statements AND assignments.

It has always meant "disable the assert statement and therefore any side 
effects the expression has". It's just that now the side effects are 
more obvious, or maybe easier to create. Even pre-572 I've been bitten 
by this, I'm ashamed to admit.

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