|
|
|
|
|
by Waterluvian
656 days ago
|
|
I get why but I’ll never not see this as a counterintuitive footgun. Edit: yes I get why. The logic is there. But my brain just can’t help but see the inverse: eg. passed = all(test_results)
I hit a case where I actually test nothing and have no results. Did I pass?Because in my brain I’m always framing things with how a loop can be run zero times. A collection of zero elements is not a case I usually have to manually cover. Edit again: did all of that confuse you? Because I was completely backwards and wrong. It’s time to clock out for the day. |
|
In other words: if you want all(a++b) == all(a) and all(b) to be true for all lists a,b, then then all([]) needs to be true.
Vice versa for any/or/False