I suggest to watch Raymond Hettinger famous Transforming Code into Beautiful, Idiomatic Python.
There is part named Dictionary Skills which should be mandatory to every pythonista (includes explanation why didn't you find dictionary values you were expecting). NB! In current versions you can't do del-trick he showed (you will get RuntimeError: dictionary changed size during iteration, reason being that d.keys() now returns view)
There is part named Dictionary Skills which should be mandatory to every pythonista (includes explanation why didn't you find dictionary values you were expecting). NB! In current versions you can't do del-trick he showed (you will get RuntimeError: dictionary changed size during iteration, reason being that d.keys() now returns view)
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.