from typing import Mapping


def update(conf, newconf):
    """Recursive update"""
    for key, value in newconf.items():
        if isinstance(value, Mapping) and value:
            returned = update(conf.get(key, {}), value)
            conf[key] = returned
        else:
            conf[key] = newconf[key]
    return conf