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

[Python-Dev] PEP 572 and assert

[Python-Dev] PEP 572 and assert [Python-Dev] PEP 572 and assertSteven D'Aprano steve at pearwood.info
Tue Jul 17 19:33:24 EDT 2018
On Wed, Jul 18, 2018 at 03:41:08AM +1000, Steven D'Aprano wrote:

> Besides, there is a legitimate use for assignment expressions in 
> assertions:
> 
>     assert (spam := something) > 2, 'not enough spam'
>     assert  sequence[foo] == 999, 'sequence item isn't 999'

Ah, obviously the index in the second line ought to be spam, not foo.


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