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
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to