4 ms·
This feels a bit like a case of a "Python from 10 years ago in my head" vs "Python from 10 years ago in reality" meme. Chained comparisons have been in Python
by devanl 2y ago
This feels a bit like a case of a "Python from 10 years ago in my head" vs "Python from 10 years ago in reality" meme.
Chained comparisons have been in Python since I started using it at 2.1. It looks to me like they've been there since at least 1.4:
https://docs.python.org/release/1.4/tut/node40.html#SECTION00660000000000000000 https://docs.python.org/release/1.4/tut/node40.html#SECTION0...
- Animats 2y agoAh. I'm thinking of [1] from 2016, when there was a plan to add short-cut evaluation to short-cut comparisons. That avoids evaluating all the terms when not necessary. But that was deferred. [1] https://peps.python.org/pep-0535/ https://peps.python.org/pep-0535/
- DonHopkins 2y agoThat's so lazy!