The below code just works fine for my simple case, but is there any generic and pythonic way?
def safe_get(d, *args): n = len(args) if n == 1: