Talk:Z12684

From Wikifunctions
Latest comment: 1 month ago by GrounderUK in topic Is an empty list all true?

True or truthy?

list of strings is truthy (Z15569) passes a list of strings, which are treated as True because they are not empty strings. Whether non-Booleans should be passed at all is phab:T358589. In any event, are all true Python (explicitly True) (Z15570) tests for explicit truth (== True). I suggest we should have separate functions for “are all truthy” and “are all True”. As defined, this function seems intended to be “are all True”, as the input argument is defined as a list of Booleans, so I have connected the test and implementation. GrounderUK (talk) 10:17, 8 April 2024 (UTC)Reply

Is an empty list all true?

I’m not convinced that an empty list should be considered all true or all false, but I don’t think it should be both. I tested If (Z802) with an empty list and discovered that it branches to else, implying that an empty list is considered False. Similarly, an unidentified Boolean is considered False. In contrast, an empty string or the Natural number zero will produce an error. GrounderUK (talk) 23:17, 8 April 2024 (UTC)Reply