From da35aef4117ad2174630afe0264c855352ede57e Mon Sep 17 00:00:00 2001 From: zzj <29055749+zjzh@users.noreply.github.com> Date: Thu, 20 Jan 2022 18:41:25 +0800 Subject: [PATCH] Update sass.py refactoring code with set comprehension which is more concise and efficient --- sass.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sass.py b/sass.py index 86992e68..d07affa8 100644 --- a/sass.py +++ b/sass.py @@ -537,10 +537,7 @@ def my_importer(path, prev): resolved path, so that importers can do relative path resolution. """ - modes = set() - for mode_name in MODES: - if mode_name in kwargs: - modes.add(mode_name) + modes = {mode_name for mode_name in MODES if mode_name in kwargs} if not modes: raise TypeError('choose one at least in ' + and_join(MODES)) elif len(modes) > 1: