Never mind the previous comment. This is for Python 3, where `items` no longer returns a list:

```
>>> from collections import defaultdict
>>> namecount = defaultdict(int)
>>> namecount["foo"] = 2
>>> namecount["bar"] = 1
>>> namecount.items()
dict_items([('bar', 1), ('foo', 2)])
>>> for k, v in namecount.items():
...     if v == 1:
...         del namecount[k]
...         
Traceback (most recent call last):
  File "<ipython-input-8-cf46515be05c>", line 1, in <module>
    for k, v in namecount.items():
RuntimeError: dictionary changed size during iteration
```