News for hackers. Stuff that matters.
Re:What the Fuck Python by zahlman on Saturday July 19, 2025 @05:16PM (#44619487)
> 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). 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".

There are no comments on this comment yet.