Hacker News new | past | comments | ask | show | jobs | submit login

There is no ambiguity. This example is invalid syntax.



In 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.


C/C++ compilers (at least, all the ones I know about) squawk about it unless you add an additional set of parentheses around the assignment.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: