4 ms·
I think they just got their operator precedences mixed up. They meant: (all(xs) and all(ys)) == all(xs + ys) This is why you should always use parentheses
by quietbritishjim 7y ago
I think they just got their operator precedences mixed up. They meant:
(all(xs) and all(ys)) == all(xs + ys)
This is why you should always use parentheses unless it's absolutely obvious! I certainly had to check the docs to find out which way round it goes. I guess normally you're not dealing with Boolean variables so having == bind tighter makes more sense:
y is not None and x == 7
- eru 7y agoYes, indeed! Sorry, I was deviating from the Python order of precedence.