[Python-ideas] Modern language design survey for "assign and compare" statements

Mike Miller python-ideas at mgmiller.net
Sat May 19 19:34:47 EDT 2018

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.


More information about the Python-ideas mailing list