On 2018-05-19 16:00, Chris Angelico wrote:
But you can't put a comparison after the assignment, if it's part of
the syntax of the 'if' statement. That's not how grammar works. So you
have two options: either the ONLY thing you can capture is the
condition value (which you already know to be truthy), or it's part of
a more general expression, and is independent of if/while. You said
yourself that the first one isn't enough. So it HAS to be an
expression feature, not a statement feature.

Sorry, may have not written clearly. But the gist of the thread is several languages found the simple form (one assignment and compare) adequate.

Believe the examples we've looked at in the various threads have been the simple form. So I argue it is enough in most cases.

-Mike

_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to