def deepupdate_dict(target, update):
	"""
	Updates dicts and calls itself recursively if a list or dict is encountered
	to perform updating at nesting levels instead of just the first one.
	Does not work with tuples.
	"""
	for k, v in update.items():
		if isinstance(v, list):
			target[k] = target.get(k, []) + v
		elif isinstance(v, dict):
			target[k] = deepupdate_dict(target.get(k, {}), v)
		else:
			target[k] = v
	return target