On Mon, Dec 21, 2020 at 7:00 PM Paul Bryan <pbr...@anode.ca> wrote: > > I know this has come up in the past. > > Could the consensus have changed regarding bool's inheritance from int? > > This is not intuitive (to me), and recently bit me as a bug: > > Python 3.9.1 (default, Dec 13 2020, 11:55:53) > > [GCC 10.2.0] on linux > > Type "help", "copyright", "credits" or "license" for more information. > > >>> {1,True} > > {1} >
That's actually nothing to do with inheritance: >>> {1, 1.0} {1} So True would have to no longer be equal to 1, and that would *definitely* break a lot of code. ChrisA _______________________________________________ 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/RMCNXNX5TCN6FRW72Y4QJR7AGJJ4ULUE/ Code of Conduct: http://python.org/psf/codeofconduct/