diff --git a/src/helpers.py b/src/helpers.py index cfbaa79dc2f35836230bed04ac88204c5fbb1ec8..f472a7ca5715c480b04b5992fe0542362c596661 100644 --- a/src/helpers.py +++ b/src/helpers.py @@ -201,19 +201,17 @@ def float_round(number: float, decimals: int = 0, round_type: Callable = math.ce return round_type(number * multiplier) / multiplier -def dict_pop(dict: Dict, pop_keys): - pop_keys = to_list(pop_keys) - return {k: v for k, v in dict.items() if k not in pop_keys} - - def list_pop(list_full: list, pop_items): pop_items = to_list(pop_items) if len(pop_items) > 1: return [e for e in list_full if e not in pop_items] else: - list_pop = list_full.copy() - list_pop.remove(pop_items[0]) - return list_pop + l_pop = list_full.copy() + try: + l_pop.remove(pop_items[0]) + except ValueError: + pass + return l_pop def dict_pop(dict_orig: Dict, pop_keys):