From d3266a47e5e7fb6eb75a6cff0b5c6282bb56c29d Mon Sep 17 00:00:00 2001 From: "FeRD (Frank Dana)" Date: Mon, 13 May 2024 14:29:06 -0400 Subject: [PATCH] More terse set-conversion code --- proselint/tools.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proselint/tools.py b/proselint/tools.py index f520537d2..9f13975dc 100644 --- a/proselint/tools.py +++ b/proselint/tools.py @@ -377,10 +377,7 @@ def reverse_existence_check( text, list, err, msg, ignore_case=True, offset=0 ): """Find all words in ``text`` that aren't on the ``list``.""" - if ignore_case: - permitted = set([word.lower() for word in list]) - else: - permitted = set(list) + permitted = set([word.lower() for word in list] if ignore_case else list) allowed_word = functools.partial( _allowed_word, permitted, ignore_case=ignore_case)