Re:The 2,500 year old history of why Python’s all([]) return...
by bowsamic on Friday August 25, 2023 @04:47PM
(#37266815)
Why should I consider the all function to be like that, rather than actually answering the question “are all the marbles black”?
Also, why am I getting downvoted? I’m starting to realise that HN is not the place to come for intellectual discussion anymore if you have anything to say that isn’t immediate agreement. I guess dang has set a flag on my account that encourages others to downvote me, because I’m not sure what other explanation there is for how my comments have been treated recently
Re:The 2,500 year old history of why Python’s all([]) return...
by stOneskull on Friday August 25, 2023 @05:23PM
(#37267224)
i think it's a 'black marble bag'. you want to make sure it only ever has black marbles in it. so you do checks on it.. does the bag only contain black marbles? you want to check there's no non-black marbles.
Re:The 2,500 year old history of why Python’s all([]) return...
by shadowgovt on Friday August 25, 2023 @05:00PM
(#37266998)
With deepest respect: I can't speak to any other comments you've made, but on this thread the downvotes are almost certainly because you've stepped into a philosophical debate that has gone on for over 2,000 years in Western philosophy and more-or-less asserted "If this must be cast to a boolean somehow, the only 'logical answer' is no." I believe the community is interpreting that as a bit dismissive both of the contents of the post and philosophy in general; one of the field's goals is to get past what we feel ought to be the answer to establish some kind of framework where that must be the answer, and your assertion is a bit dismissive of the other viewpoint (which, FWIW, happens to be the modern orthodoxy; IIUC your preferred answer is the old orthodoxy that leads to logical paradoxes and has therefore been put on the shelf as less useful).
Re:The 2,500 year old history of why Python’s all([]) return...
by 8note on Friday August 25, 2023 @08:23PM
(#37268688)
You could define an alternative All where where it means (at least one is true) && (for each n, n is true)
But is it useful?
Suppose I'm a bus driver and I ask "all aboard?"
I'd expect that if the answer is false, I'm missing somebody, and not that the bus is empty
A marble is in the bag -> the marble is black = True, even if there are no marbles in the bag. You can consider the "all" method as asking for the truth value of "A marble is in the bag -> the marble is black"