Union python dictioniaries with function on collision
===

In Python, is there a way to merge dictionaries and do something on collision? I'm looking for an idiom equivalent to the unionWith function in Haskell: http://hackage.haskell.org/packages/archive/containers/0.5.0.0/doc/html/Data-Map-Lazy.html#v:unionWith


    >>> unionWith(lambda x,y: x + y, {'a' : [42], 'b' : [12], c : [4]}, {'a' : [3], 'b' : [2], 'd' : [0]})
    {'a' : [42,3], 'b' : [12,2], 'c' : [4], 'd': [0]}