Hmm, I have no idea about the speed comparisons between programming languages, but as far as I know, ability to call for swapping two variables in a single line does not necessarily mean that it is going to be interperetad and executed faster. It's just the way you tell things to compiler/interpreter, and does not give clues about speed I think. Single line of swapping code could take longer or shorter to execute. Speed is not releated to that.
It takes longer to write that code anyways. If that is the issue.
> i know it works but using tuple type in python is more simple and
> elegant: just one step.
Over and above Batuhan's very correct point, it is worth mentioning
that Python, JS, and even message-passing in plain-vanilla Max have
far, far more overhead than any of the code snippets listed in this
Nick's catchy code disassembles on PPC to
and the more standard swap-with-temp-var disassembles to
Either way it's very few cycles, your Python code will not be faster
than that. Sending a message through a patch cord is many times the
number of cycles.
If it's typing and transparency you're concerned about, write a Swap