How do I check integer overflow in Python?


#1
if A > (2**31)-1 or A < -1*(2**31):
    return 0

This isn’t working for me.