On Mon, Mar 26, 2018 at 12:24 PM, Guido van Rossum <gu...@python.org> wrote: > I gotta say I'm warming up to := in preference over 'as', *if* we're going > to do this at all (not a foregone conclusion at all).
So am I, primarily due to its lack of syntactic ambiguities. > The scope question is far from easy though. I find it particularly grating > that an inline assignment occurs in an 'if' statement, its scope is the > entire body of the 'if'. If that body is two pages long, by the end of it > the reader (or even the writer!) may well have lost track of where it was > defined and may be confused by the consequence past the end of the body. I think this one can be given to style guides. The useful situations (eg regex match capturing) are sufficiently valuable that the less-useful ones can just come along for the ride, just like "x = lambda: ..." is perfectly valid even though "def" would be preferable. ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/