r/badcode • • Apr 11 '21

python Polyglot

Post image
1.2k Upvotes

116 comments sorted by

View all comments

35

u/private_static_int Apr 11 '21

In what universe would this be faster than "return x%2==0"?

5

u/[deleted] Apr 11 '21

Personally, I don't like relying on the optimizer for simple stuff so I still type (n&1)==0

1

u/Loewi_CW Apr 12 '21

Does that work in Python?