From f0bd1cb481947a81a5ea164aa333d5224f194702 Mon Sep 17 00:00:00 2001 From: Chris Milson Date: Thu, 18 Feb 2021 19:05:40 +0900 Subject: [PATCH] Update explanation for All-true-ation #255 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c6d80b6..7f48185 100644 --- a/README.md +++ b/README.md @@ -1273,8 +1273,8 @@ Why's this True-False alteration? ``` - `all([])` returns `True` since the iterable is empty. -- `all([[]])` returns `False` because `not []` is `True` is equivalent to `not False` as the list inside the iterable is empty. -- `all([[[]]])` and higher recursive variants are always `True` since `not [[]]`, `not [[[]]]`, and so on are equivalent to `not True`. +- `all([[]])` returns `False` because the passed array has one element, `[]`, and in python, an empty list is falsy. +- `all([[[]]])` and higher recursive variants are always `True`. This is because the passed array's single element (`[[...]]`) is no longer empty, and lists with values are truthy. ---