syntax difference

bart4858 at gmail.com bart4858 at gmail.com
Tue Jun 19 17:07:32 EDT 2018


Do you think that a feature like swap(x,y) literally only works on two simple variables? X and y represent any two lvalue expressions. For example, a[I] and a[I+1]. Python will evaluate each twice.

My version sets up two references then exchanges what they point to with one bytecode. 

-- 
Bart



More information about the Python-list mailing list