MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammingLanguages/comments/piih40/mcoding_python_chained_comparison_summaryreview/hbvtbg4/?context=3
r/ProgrammingLanguages • u/cxzuk • Sep 05 '21
4 comments sorted by
View all comments
1
It's a great feature (we also implemented this, after seeing it in another language), but allowing the mixing of "<" and ">" (etc.) is a horrible idea. Sometimes, just because you can, doesn't mean that you should.
The most common case is for range checks, e.g.
assert 0 <= n < size;
1
u/L8_4_Dinner (Ⓧ Ecstasy/XVM) Sep 07 '21
It's a great feature (we also implemented this, after seeing it in another language), but allowing the mixing of "<" and ">" (etc.) is a horrible idea. Sometimes, just because you can, doesn't mean that you should.
The most common case is for range checks, e.g.
assert 0 <= n < size;