3 ms·
There is no ambiguity. This example is invalid syntax.
by raymondh 7y ago
There is no ambiguity. This example is invalid syntax.
- joshuamorton 7y agoIn Python yes, but the post I responded to asked why they settled on a different assignment syntax for expressions. It was to avoid that ambiguity (or error prone pattern, if you prefer) which is present in, say, C.
- ryl00 7y agoC/C++ compilers (at least, all the ones I know about) squawk about it unless you add an additional set of parentheses around the assignment.