bool and int

Weatherby,Gerard gweatherby at uchc.edu
Tue Jan 24 15:32:49 EST 2023


https://peps.python.org/pep-0285/

From: Python-list <python-list-bounces+gweatherby=uchc.edu at python.org> on behalf of rbowman <bowman at montana.com>
Date: Tuesday, January 24, 2023 at 3:01 PM
To: python-list at python.org <python-list at 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.

C# is pickier, which I guess is a good thing.
--
https://urldefense.com/v3/__https://mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hdxuMNsprOXvH5ouxGfbGLLq6wuXs-_gOESRVYUxDsHYCmlrpv9ru-WYMziYU4FRdum02bS6DfRnNDnCNQ$<https://urldefense.com/v3/__https:/mail.python.org/mailman/listinfo/python-list__;!!Cn_UX_p3!hdxuMNsprOXvH5ouxGfbGLLq6wuXs-_gOESRVYUxDsHYCmlrpv9ru-WYMziYU4FRdum02bS6DfRnNDnCNQ$>


More information about the Python-list mailing list