Message381790
There's no bug here.
"&" is the bitwise Boolean logical-and operator on integers. For example,
>>> 1 & 2
0
>>> 1 & 3
1
It binds more tightly than the "==" equality-testing operator. To get the result you want, you would need to add more parentheses to override the natural operator precedence:
>>> (a == 10) & (not(a!=b)) & (b == 10)
True
But, more to the point, what you probably really want is the "and" logical operator, not the bitwise integer "&" operator:
>>> a == 10 and (not(a!=b)) and b == 10
True |
|
Date |
User |
Action |
Args |
2020-11-25 04:56:28 | tim.peters | set | recipients:
+ tim.peters, Kshitish |
2020-11-25 04:56:28 | tim.peters | set | messageid: <1606280188.69.0.477760221318.issue42456@roundup.psfhosted.org> |
2020-11-25 04:56:28 | tim.peters | link | issue42456 messages |
2020-11-25 04:56:28 | tim.peters | create | |
|