So you think you know Python
Quiz: what is the value of foo after this code is run?
foo=[0];bar=[foo];foo[0]=bar
Extra credit:
1) what is bar[0]
2) foo==bar
foo=[0];bar=[foo];foo[0]=bar
Extra credit:
1) what is bar[0]
2) foo==bar
It's just a circular data structure, many (or even most) languages give you enough rope to hang yourself with one of those. Nothing particularly surprising or Python-specific about it.
bar[0] = foo
false
if wrong please correct accordingly.