B
braver
I need a magical expanding hash with the following properties:
* it creates all intermediate keys
meh['foo']['bar] = 1
-- works even if meh['foo'] didn't exist before
* allows pushing new elements to leaves which are arrays
meh['foo']['list] << elem1
meh['foo']['list] << elem2
* allows incrementing numeric leaves
meh['foo']['count'] += 7
* serializable
I have such a class in ruby. Can python do that?
* it creates all intermediate keys
meh['foo']['bar] = 1
-- works even if meh['foo'] didn't exist before
* allows pushing new elements to leaves which are arrays
meh['foo']['list] << elem1
meh['foo']['list] << elem2
* allows incrementing numeric leaves
meh['foo']['count'] += 7
* serializable
I have such a class in ruby. Can python do that?