defaultdict mit OrderedDict problem
Verfasst: Dienstag 14. Mai 2013, 05:36
Hi,
Wie koennte man das folgende Problem loesen?
Vielen Dank im Vorraus
Wie koennte man das folgende Problem loesen?
Code: Alles auswählen
>>> from collections import defaultdict
>>> from collections import OrderedDict
>>> a = defaultdict(lambda: OrderedDict)
>>> a[1]["X.1"] = 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'type' object does not support item assignment
>>>