On 2023-01-24 20:32, Weatherby,Gerard wrote:
https://peps.python.org/pep-0285/

From: Python-list <python-list-bounces+gweatherby=uchc....@python.org> on behalf of 
rbowman <bow...@montana.com>
Date: Tuesday, January 24, 2023 at 3:01 PM
To: python-list@python.org <python-list@python.org>
Subject: Re: bool and int


bool is a subtype of integer. I never dug that deep into Python's guts but
I assume it goes back to boolean being an afterthought in C. Some people
fancy it up with #defines but I always use int.  0 is false, anything else
is true.

bool was introduced early in Python 2. Before then 0 and 1 were used for false and true, like in C, which also gained 'false' and 'true'.

For backwards compatibility, bool was made a subclass of int.

C# is pickier, which I guess is a good thing.

--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to