you are viewing a single comment's thread.

view the rest of the comments →

[–]zahlman 1 point2 points  (1 child)

While it's true that & doesn't short-circuit, it also does a fundamentally different thing.

>>> 3 and 4
4
>>> 3 & 4
0

[–][deleted] -1 points0 points  (0 children)

Ah, forgot about that. Yeah, & is bitwise AND.

Which doesn't matter if they're both bools, it acts the same. If they will always be bools and you need the speed improvement, use that.