Remove swap().

The more Pythonic way to do this is a, b = b, a.