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 3, 2022
1 parent 0ebaee3 commit c1df8d7
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 @@ -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)):
Expand Down

0 comments on commit c1df8d7

Please sign in to comment.