News for hackers. Stuff that matters.
Re:The 2,500 year old history of why Python’s all([]) return... by fasterik on Saturday August 26, 2023 @02:20PM (#37275426)
all(m=="white" for m in marbles)

By De Morgan's laws, this is equivalent to

not any(m != "white" for m in marbles)

If you want all(m=="white" for m in marbles) to evaluate to False for the empty set, then any(m != "white" for m in marbles) has to evaluate to True for the empty set, or you have to give up on De Morgan's laws.

This is how standard first-order logic works. Again, you're welcome to try to make your own system of logic that's different, but good luck doing that while preserving all of our theorems in set theory and mathematics.

There are no comments on this comment yet.