python convert defaultdict to dict code example
Example: python defaultdict to dict
>>> #You can simply call dict:
>>> a
defaultdict(<type 'list'>, {'1': ['b', 'a'], '3': ['b'], '2': ['a']})
>>> dict(a)
{'1': ['b', 'a'], '3': ['b'], '2': ['a']}
# but remember that a defaultdict is a dict
# (with some special behavior, check source):
>>> isinstance(a, dict)
True