3 ms·
Its 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
by dragonwriter 3y ago
Its 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.)