The function pick(options, title) doesn't return a tuple, but an array of tuples.
Steps to reproduce
I run the code given in example:
from pick import pick
title = "Please choose your favorite programming language: "
options = ["Java", "JavaScript", "Python", "PHP", "C++", "Erlang", "Haskell"]
option, index = pick(options, title)
print(option)
print(index)
Expected
Variables options and index are filled.
Actual result
Exception has occurred: ValueError
not enough values to unpack (expected 2, got 1)
In debug mode, the function returns:
[('Python', 2)]
Suggestion
Since there is a "multiselect" option, I understand why it returns an array, but it breaks legacy scripts.
I'ld suggest to return an array of tuples ony when multiselect=True.
This is an unexpected change introduced in https://github.com/wong2/pick/pull/59
I've reverted to the old behavior in v1.4.0, please upgrade.
Sorry for the inconvenience.
Description
The function
pick(options, title)
doesn't return a tuple, but an array of tuples.Steps to reproduce
I run the code given in example:
Expected
Variables
options
andindex
are filled.Actual result
In debug mode, the function returns:
Suggestion
Since there is a "multiselect" option, I understand why it returns an array, but it breaks legacy scripts. I'ld suggest to return an array of tuples ony when
multiselect=True
.Additional informations
Python version: 3.10.5 Pick version: 1.3.0