So I wanted to swap to objects, and I prefer to write short clean code, especially to carry out simple processes. The idea was that I have two objects, in this case treeA and treeB and I wanted treeA to be the deeper of the two trees. Now the long way would look something like this:
if treeA.depth < treeB.depth:
tree = treeA
treeA = treeB
treeB = treeWhich is a little ugly, 4 lines to reorder something, so there neat trick is that if you want to swap two objects a and b simply use:
a,b = b,a
So the above code becomes: