On 2021-08-22 17:36, Thomas Grainger wrote:
bool((len(collection) == 0) is True) == True and issubclass(True, bool)
'True' is a reserved word, so you don't need to check it.
However, 'bool' might have been overridden, so:
__builtins__.bool((len(collection) == 0) is True) == True
Come to think of it, 'len' might have been overridden too, so:
__builtins__.bool((__builtins__.len(collection) == 0) is True) == True
On Sun, 22 Aug 2021, 17:09 Valentin Berlier, <[email protected]
<mailto:[email protected]>> wrote:
> (len(collection) == 0) is True
bool((len(collection) == 0) is True) == True
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/SL5PO4L3DWRA367WZK2CENW3VUJDFIB2/
Code of Conduct: http://python.org/psf/codeofconduct/