pythonic swap