<div dir="ltr">A quick follow-up: PEP 572 currently has two ideas: (a) introduce := for inline assignment, (b) when := is used in a comprehension, set the scope for the target as if the assignment occurred outside any comprehensions. It seems we have more support for (a) than for (b) -- at least Nick and Greg seem to be +0 or better for (a) but -1 for (b). IIRC (b) originated with Tim. But his essay on the topic, included as Appendix A (<a href="https://www.python.org/dev/peps/pep-0572/#appendix-a-tim-peters-s-findings" target="_blank">https://www.python.org/dev/peps/pep-0572/#appendix-a-tim-peters-s-findings</a>) does not even mention comprehensions. However, he did post his motivation for (b) on python-ideas, IIRC a bit before PyCon; and the main text of the PEP gives a strong motivation (<a href="https://www.python.org/dev/peps/pep-0572/#scope-of-the-target" target="_blank">https://www.python.org/dev/peps/pep-0572/#scope-of-the-target</a>). Nevertheless, maybe we should compromise and drop (b)?<br clear="all"><div><br>-- <br><div dir="ltr" class="m_4811793965691922396gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div></div></div>