r/badcode • • Aug 27 '21

python Is this code bad or sugoi?

Post image
1.0k Upvotes

154 comments sorted by

View all comments

Show parent comment

2

u/TinyBreadBigMouth Aug 29 '21

They do completely different things, so there isn't really any style choice to be had there. In general the only reason to use binary OR is if you're doing bit manipulation. I.e., 0b00101 | 0b10110 == 0b10111.

1

u/coldnebo Aug 29 '21

oh sorry, duh. nevermind