opcode

Is Python unpacking atomic w.r.t. interrupts?

Is Python unpacking atomic w.r.t. interrupts? Question: Given the following example try: a, b = 0, 0 for _ in range(100): a, b = (a+1, b+1) except KeyboardInterrupt: assert a == b could an AssertionError be thrown? If so, is there a way to prevent it, i.e. to ensure that either both of a and …

Total answers: 1