Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
DimitriPapadopoulos committed Jan 4, 2022
1 parent fd75e95 commit 1cc9b1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion codespell_lib/_codespell.py
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,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 misspelling.data.split(",")]
while not r:
print("%s Choose an option (blank for none): " % line, end='')
for i in range(len(opt)):
Expand Down

0 comments on commit 1cc9b1f

Please sign in to comment.