syntax difference

Gregory Ewing greg.ewing at canterbury.ac.nz
Wed Jun 20 02:00:12 EDT 2018


Bart wrote:
> a[1],b[fn()] = b[fn()],a[1]

I suppose if you find yourself doing heaps of swaps with
complicated indexes it could be useful to have a swap
primitive. In my experience it's a pretty rare thing to
want to do, though.

Also it only covers one special case of all possible
permutations. It won't help you with a, b, c = b, c, a
for example.

-- 
Greg



More information about the Python-list mailing list