def special_handling(key: str, val: str, ans: Dict) -> bool: if key == 'map': x = parse_kittens_key(val, args_funcs) if x is not None: action, key_def = x ans['key_definitions'][key_def] = action return True return False
def special_handling(key, val, ans): if key == 'map': action, *key_def = parse_kittens_key(val, args_funcs) ans['key_definitions'][tuple(key_def)] = action return True
def parse_map(val: str) -> Iterable[KittensKeyDefinition]: x = parse_kittens_key(val, func_with_args.args_funcs) if x is not None: yield x