I have the following dict:

aDict = {
    "a" : {
        "b" : {
            "c1" : {},
            "c2" : {},
        }
    }
}

a second dict:

aSecondDict = { 
    "d1" : {},
    "d2" : {},
    "d3" : {},
}

and a "path" tuple:

path = ( "a", "b", "c2" )

I now want to add the second dict to the first at the path provided by the tuple:

aResultDict = {
    "a" : {
        "b" : {
            "c1" : {},
            "c2" : {
                "d1" : {},
                "d2" : {},
                "d3" : {},
            },
        }
    }
}

What is the pythonic way of achieving this?

Edit
Report