Message382788
Please ask for help on StackOverflow or the general Python mailing list. Your understanding of the operations is incorrect.
"&" is NOT a logical operator ("and" is). It's a bitwise operator on integers.
>>> 10 & 10
10
>>> bin(10)
'0b1010'
The last bit is 0, so when you "&" the result with True (which is equivalent to integer 1) the result is 0:
>>> (10 & 10) & True
0
and the integer 0 is treated as False in a Boolean context. |
|
Date |
User |
Action |
Args |
2020-12-09 06:29:09 | tim.peters | set | recipients:
+ tim.peters, Kshitish |
2020-12-09 06:29:09 | tim.peters | set | messageid: <1607495349.24.0.898498329684.issue42456@roundup.psfhosted.org> |
2020-12-09 06:29:09 | tim.peters | link | issue42456 messages |
2020-12-09 06:29:08 | tim.peters | create | |
|