Antoon Pardon wrote: > Even this doesn't: > > def foo(): > if False: > a = 1 > else: > b = a > > a = 1 > foo() > > Yet seems to work (which I think is an error in the optimisation; What definition of 'seems to work' are you using? It throws an UnboundLocalError exception so you'll know pretty quickly that something is wrong.