MAX_BIT_COMPLIMENT = -2 ** 32

def aplusb(a, b):
    while b != 0:
        if b == MAX_BIT:
            return a ^ MAX_BIT_COMPLIMENT
carry = a & b
a = a ^ b
b = carry << 1
return a
A + B без арифметических операторов, Python против C++