2 ms·
"all" and "none" are simultaneously true, which makes this a tricky edge case that needs to be explicitly accounted for.
by Salgat 3y ago
"all" and "none" are simultaneously true, which makes this a tricky edge case that needs to be explicitly accounted for.
- dragonwriter 3y agoIts necessary that all and none are both true of empty lists, if they are both defined for empty lists, because otherwise the invariant that all(xs) == none(not x for x in xs) [0] would not hold. [0] yes, “none()” doesn’t actually exist in Python, but we can imagine that it did, and see that if it did, it should have this relationship.)