From c1df8d776be197b1d63cae65f0164c65d3722d23 Mon Sep 17 00:00:00 2001 From: Dimitri Papadopoulos <3234522+DimitriPapadopoulos@users.noreply.github.com> Date: Mon, 3 Jan 2022 19:50:41 +0100 Subject: [PATCH] Simplify code The list comprehension is shorter than the map() version. I feel it is also simpler, although that is debatable. This is consistent with the previous commit. --- codespell_lib/_codespell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codespell_lib/_codespell.py b/codespell_lib/_codespell.py index 2d7fc6a809..f634cfeab9 100644 --- a/codespell_lib/_codespell.py +++ b/codespell_lib/_codespell.py @@ -527,7 +527,7 @@ def ask_for_word_fix(line, wrongword, misspelling, interactivity): # we ask the user which word to use r = '' - opt = list(map(lambda x: x.strip(), misspelling.data.split(','))) + opt = [w.strip() for w in fixword.split(",")] while not r: print("%s Choose an option (blank for none): " % line, end='') for i in range(len(opt)):