I disagree that doing arithmetic on boolean variables doesn't make sense. Indicator variables which take a value of either zero are one are extremely common. Dirac or Kronecker delta functions are also examples of functions where it arithmetically makes sense to talk about values in the boolean domain. Of course that does mean that you define True as 1 and False as 0, but that is a very standard convention and it is the case in Python.
I don't have a strong opinion on the proposal itself, but saying "arithmetic on booleans doesn't doesn't make mathematical sense" is False. On Mon, Jun 22, 2020 at 5:08 AM Greg Ewing <greg.ew...@canterbury.ac.nz> wrote: > On 22/06/20 12:19 pm, Neil Girdhar wrote: > > I'm just curious if there was a reason why Boolean was omitted from the > > numeric tower in the numbers library? > > Python's bool type is a subclass of int for historical reasons, > not because it's conceptually a numeric type. Doing arithmetic on > it doesn't really make mathematical sense. > > -- > Greg > _______________________________________________ > 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/CMDSMDVCT5ABSLILV3U772QDLI2IUCAZ/ > Code of Conduct: http://python.org/psf/codeofconduct/ > -- -Dr. Jon Crall (him)
_______________________________________________ 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/WZTFFH4BHZAS4YSKVZOSS6JTA3VYFIDZ/ Code of Conduct: http://python.org/psf/codeofconduct/