In Python, I've seen two variable values swapped using this syntax:
left, right = right, left
Python evaluates expressions from left to right. Notice that while evaluating an assignment, the right-hand side is evaluated before the left-hand side.
That means the following for the expression
a,b = b,a :
b,ais evaluated, that is to say a tuple of two elements is created in the memory. The two element are the objects designated by the identifiers
a, that were existing before the instruction is encoutered during an execution of program
abe assigned to the first element of the tuple (which is the object that was formely b before the swap because it had name
bis assigned to the second element of the tuple (which is the object that was formerly a before the swap because its identifiers was
This mechanism has effectively swapped the objects assigned to the identifiers
So, to answer to your question is: YES, it's the standard way to swap two identifiers on two objects.
By the way, the objects are not variables, they are objects.