Funny, I thought I knew that about global and was pretty sure it had to be right after the def, but couldn't find it in the docs (docs say 'has to be in same code block') so I left it where it was. I merely changed some variable names around. 'The Real WTF' indeed gave the correct simplification.
About the meaning of the indices [0..2], they don't really matter too much. I'm not sure why I left those comments in... extra obfuscation perhaps. The actual code isn't mine, and while the use of str() isn't the wtf, the person who wrote it both misunderstood assignments as well as a common problem with default parameters in Python. I'd hope I won't have to explain -how- they were misunderstood.. and at the same time actually managed to produce working code.