From 1978199746ddff4c2c208a2f74aa9b561853e4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20B=C3=B6hm?= Date: Wed, 27 Sep 2023 11:07:18 +0200 Subject: [PATCH] Split any(filter()) into two statements to aid type checking --- varats-core/varats/base/configuration.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/varats-core/varats/base/configuration.py b/varats-core/varats/base/configuration.py index 1387040dd..cdf6cb8e5 100644 --- a/varats-core/varats/base/configuration.py +++ b/varats-core/varats/base/configuration.py @@ -441,12 +441,11 @@ def set_config_option(self, option_name: str, value: tp.Any) -> None: self.add_config_option(ConfigurationOptionImpl(option_name, value)) def get_config_value(self, option_name: str) -> tp.Optional[tp.Any]: - return any( - filter( - lambda option: option.name == option_name, - self.__patch_feature_tags - ) + filtered_options = filter( + lambda option: (option.name == option_name), + self.__patch_feature_tags ) + return any(filtered_options) def options(self) -> tp.List[ConfigurationOption]: return list(self.__patch_feature_tags)