From 0b66c96f5e70ec0cd6d1127fc5a3013776cdb827 Mon Sep 17 00:00:00 2001 From: Emmanuel Garette Date: Mon, 16 Apr 2018 21:07:20 +0200 Subject: [PATCH] simplify --- tiramisu/option/baseoption.py | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/tiramisu/option/baseoption.py b/tiramisu/option/baseoption.py index 5dc1e05..1cb49f8 100644 --- a/tiramisu/option/baseoption.py +++ b/tiramisu/option/baseoption.py @@ -203,20 +203,18 @@ class Base(object): calculator.__name__, self.impl_get_display_name())) has_index = False - if is_multi and func_args: - # there is extra args/kwargs - if not self.impl_is_dynoptiondescription(): - if calculator_params is None: - calculator_params = Params() - params = list(calculator_params.args) - if add_value: - # only for validator - params.append(ParamOption(self)) - func_args.pop() - if func_args: - has_index = True - params.append(ParamIndex()) - func_args.pop() + if is_multi and func_args and not self.impl_is_dynoptiondescription(): + if calculator_params is None: + calculator_params = Params() + params = list(calculator_params.args) + if add_value: + # only for validator + params.append(ParamOption(self)) + func_args.pop() + if func_args: + has_index = True + params.append(ParamIndex()) + func_args.pop() calculator_params.args = tuple(params) if func_args: raise ConfigError(_('missing those arguments "{}" in function "{}" for "{}"'