magmax / python-inquirer

A collection of common interactive command line user interfaces, based on Inquirer.js (https://github.com/SBoudrias/Inquirer.js/)
MIT License
992 stars 98 forks source link

Tuples as list choices no longer print as expected #515

Closed dns13 closed 7 months ago

dns13 commented 7 months ago

The following example prints the integer part of the selected entry with v3.2.1 but the string entry in v3.2.2. I think this is a regression and not working as expected.

import inquirer

entries = [
    ("one", 1),
    ("two", 2),
    ("three", 3)
]

questions = [
    inquirer.List('device', message="test", choices=entries),
]

answers = inquirer.prompt(questions)

print(answers['device'])

With v3.2.1: 2 With v3.2.2: two

Cube707 commented 7 months ago

Moin!,

the str and repr have always been different for TaggedValue pairs, one is the value and one the tag. But this shouldn't have chnanged. I will investigate.

Cube707 commented 7 months ago

yes it seems to be regression and will be fixed

dns13 commented 7 months ago

Thank you!