Not necessarily 1 byte. Like some windows BOOLs are (were?) typedef to int, so probably 4 or 8 bytes. And Python built bools on their arbitrary precision int type, so they're... some weird size, and the size is different for True and False
Unfortunately, it doesn't work like that in any languages I use. If you set any bit in a boolean's byte, the boolean is now true. This is why you often see crazy shit like:
bool a = !(!(b))
to guarantee that there's either a 1 or a 0 in the boolean.
View all comments
Show parent comment
13
u/Dry-War7589 Oct 07 '26
Yes but no. A bool is a single bit, but a single bit isnt addressable, so you use a byte, which is addressible