def update(dst, src):
stack = [(dst, src)]<EOL>def isdict(o):<EOL><INDENT>return hasattr(o, '<STR_LIT>')<EOL><DEDENT>while stack:<EOL><INDENT>current_dst, current_src = stack.pop()<EOL>for key in current_src:<EOL><INDENT>if key not in current_dst:<EOL><INDENT>current_dst[key] = current_src[key]<EOL><DEDENT>else:<EOL><INDENT>if isdict(current_src[key]) and isdict(current_dst[key]):<EOL><INDENT>stack.append((current_dst[key], current_src[key]))<EOL><DEDENT>else:<EOL><INDENT>current_dst[key] = current_src[key]<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return dst<EOL>
Recursively update the destination dict-like object with the source dict-like object.

    Useful for merging options and Bunches together!

    Based on:
    http://code.activestate.com/recipes/499335-recursively-update-a-dictionary-without-hitting-py/#c1