[New-bugs-announce] [issue34237] faq/design: PEP 572 adds assignment expressions

Jonathan Fine report at bugs.python.org
Thu Jul 26 10:19:36 EDT 2018


New submission from Jonathan Fine <jfine2358 at gmail.com>:

The title says it all.
faq/design: PEP 572 adds assignment expressions

https://docs.python.org/3.8/faq/design.html#why-can-t-i-use-an-assignment-in-an-expression
[Can't use] this C idiom:
while (line = readline(f)) {
    // do something with line
}

https://www.python.org/dev/peps/pep-0572/
while chunk := file.read(8192):
   process(chunk)

----------
assignee: docs at python
components: Documentation
messages: 322430
nosy: docs at python, jfine2358
priority: normal
severity: normal
status: open
title: faq/design: PEP 572 adds assignment expressions
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34237>
_______________________________________


More information about the New-bugs-announce mailing list