3 ms·
Python has a bunch of special cases like this that make the code more readable (according to it's creators): `x not in xs` --> `not (x in xs)` `0 < x < 10` -->
by uryga 10y ago
Python has a bunch of special cases like this that make the code more readable (according to it's creators):
`x not in xs` --> `not (x in xs)`
`0 < x < 10` --> `0 < x and x < 10`
`x = y = 5` --> (expanded above)
`in` is used both in `for...in...:` and `x in xs`
I feel like Python will gladly sacrifice being 'small and lean' if it leads to gains in readability, although they don't introduce these willy-nilly. Obviously, a lot of it is subjective, but I happen to mostly like it.