3 ms·
> It doesn't make sense no matter which way you evaluate it It makes sense when you evaluate it the way it's intended to be understood (https://stackoverflow.c
by zahlman 1y ago
> It doesn't make sense no matter which way you evaluate it
It makes sense when you evaluate it the way it's intended to be understood (https://stackoverflow.com/questions/6074018 https://stackoverflow.com/questions/6074018). There are other languages that do this, and it was consciously designed to work this way. The idea that you should have to evaluate one of the operators "first" may make sense to someone trying to implement a parser with techniques from the 70s, but for languages like Python, the design is clearly more about what makes sense for the code author.
Arguably it's surprising that `in` is treated as on par with `==`. But on the other hand, even someone trying to implement a parser with techniques from the 70s would have to admit that both are "relational operators".