As part of answering another question, I wrote the following code whose behaviour seems bizarre at first glance:
print True # outputs true
Imagine this instead:
A = True
B = False
print A # true
A = B; print A # false
A = A; print A # false, because A is still false from before
A = not A; print A # true, because A was false, so not A is true
The exact same thing is going on, but in your version it's confusing, because you don't expect that you can redefine True and False.