Can we have an ordered dictionary, with some default value?
As in case of defaultdict
, i can define something like:
a = collections.defaultdict(lambda:[True,True])
Can we have the above lambda
functionality, but have elements inserted in the dict such that the order is maintained?