>>> from collections import defaultdict
>>> dd = defaultdict(list)
>>> dd
<defaultdict object at 2006e7d0>
>>> dd.items()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'defaultdict' object has no attribute 'items'
defaultdict doesn't have an items() method, so iterating over it is a bit of a pain in the neck. Also no __repr__(), but that's not totally necessary I guess.
defaultdict
doesn't have anitems()
method, so iterating over it is a bit of a pain in the neck. Also no__repr__()
, but that's not totally necessary I guess.