From: Mauro Scomparin Date: Mon, 16 Sep 2019 20:48:52 +0000 (+0200) Subject: forse X-Git-Url: https://git.scompo.it/?a=commitdiff_plain;h=7c31b86f800eab4b07f8d7109f1ec7ce43c52a5c;p=money.git forse --- diff --git a/money/money.py b/money/money.py index 0786830..a2f3553 100755 --- a/money/money.py +++ b/money/money.py @@ -216,7 +216,8 @@ def latest_movements(): write_latest_movements(data_file, resulting_config) def mov_filter(movs, filter): - return list(filter(lambda m: re.match(filter, m[DESCRIPTION_FIELD_NAME]))) + p = re.compile(filter) + return [m for m in movs if p.match(m[DESCRIPTION_FIELD_NAME])] def filter_regex_movements(data_file, conf, filter): movements = load_file(data_file)