On Sun, Aug 22, 2021, 1:07 PM MRAB <pyt...@mrabarnett.plus.com> wrote:

> 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


Bug report: I had to override __builtins__ please fix your code :)

>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/65J7M4VRPF2MNHFY655BD4XTMVCL2QS2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to