Steven D'Aprano <steve+comp.lang.python at pearwood.info> writes: > for k, v in mydict.items(): > del(k) That looks wrong: it's deleting k from what? > instead of the more obvious > for v in mydict.values(): > ... Maybe you mean while mydict: k, v = mydict.popitem() ...