diff --git a/src/inquirer/questions.py b/src/inquirer/questions.py index 741d7780..e1fb427e 100644 --- a/src/inquirer/questions.py +++ b/src/inquirer/questions.py @@ -60,7 +60,7 @@ def __init__( self._validate = validate self.answers = {} self.show_default = show_default - self.hints = hints or {} + self.hints = hints self._other = other if self._other: diff --git a/src/inquirer/render/console/__init__.py b/src/inquirer/render/console/__init__.py index 7e0d84d2..70ed6685 100644 --- a/src/inquirer/render/console/__init__.py +++ b/src/inquirer/render/console/__init__.py @@ -93,7 +93,9 @@ def _print_header(self, render): def _print_hint(self, render): msg_template = "{t.move_up}{t.clear_eol}{color}{msg}" - hint = render.get_hint() + hint = "" + if render.question.hints is not None: + hint = render.get_hint() color = self._theme.Question.mark_color if hint: self.print_str( diff --git a/tests/integration/console_render/test_list.py b/tests/integration/console_render/test_list.py index c4b2e747..7cd3dea7 100644 --- a/tests/integration/console_render/test_list.py +++ b/tests/integration/console_render/test_list.py @@ -165,3 +165,19 @@ def test_second_hint_is_shown(self): sut.render(question) self.assertInStdout("Bar") + + def test_taggedValue_with_dict(self): + stdin = helper.event_factory(key.DOWN, key.ENTER) + message = "Foo message" + variable = "Bar variable" + choices = [ + ("aa", {"a": 1}), + ("bb", {"b": 2}), + ] + + question = questions.List(variable, message, choices=choices) + + sut = ConsoleRender(event_generator=stdin) + sut.render(question) + + self.assertInStdout("bb")