Using python’s boolean & operator to check for flag in pygame surface doesnt return expected flag
While writing my game in pygame I was trying to use the XOR (^) binary operator to ‘toggle’ flags any flag I passed to a function. However I kept running into Overflow errors (and Warning: re-creating window in toggle_fullscreen action()
errors).
To debug this I tried to use the & operator to check if the flags were being properly detected and compare it to the constant value provided by pygame.