Most Straightforward Python Solution!
My code\n\n\nclass Solution(object):\n    def getSum(self, a, b):\n        """\n        :type a: int\n        :type b: int\n        :rtype: int\n        """\n  
My code\n\n```\nclass Solution(object):\n    def getSum(self, a, b):\n        """\n        :type a: int\n        :type b: int\n        :rtype: int\n        """\n        if a == 0:\n            return b\n        elif b == 0:\n            return a\n        \n        mask = 0xffffffff\n\n        # in Python, every integer is associated with its two's complement and its sign.\n        # However, doing bit operation "& mask" loses the track of sign. \n        # Therefore, after the while loop, a is the two's complement of the final result as a 32-bit unsigned integer. \n        while b != 0:\n            a, b = (a ^ b) & mask, ((a & b) << 1) & mask\n\n        # a is negative if the first bit is 1\n        if (a >> 31) & 1:\n            return ~(a ^ mask)\n        else:\n            return a\n            \n```\n\nIdea:\nAdding two integers `a` and `b` (no matter positive or negative) can always be boiled down into 3 steps:\n1. convert `a` and `b` into two's complements. \n2. add both two's complements. The result is a new two's complement\n3. convert the result back to integer\n\nTwo things to note:\n1.  In Python, every integer is associated with its two's complement and its sign. However, doing bit operation "& mask" loses the track of sign. For example, `-1 & 0xffffffff` becomes a huge positive number 4294967295. Therefore, after the while loop, a is the two's complement of the final result as a **32-bit unsigned integer**.  \n2. The magic is that if there is a negative integer `n`, and its unsigned 32-bit two's complement is `m`, then `m = ~(n ^ 0xffffffff)` and `n = ~(m ^ 0xffffffff)`. So using this magic, you can do the conversion in step 3.
[]