Feature request: Unsorted flag for 'multi_select' return object
Opened this issue · 2 comments
Dear Ingo,
first of all many thanks for this nice package, if I run into you in Seecasino you'll get at least a coffee ;-)
I'd like to use your module for selections where I want to keep track of the selection order. If I understand your code correctly, I could just remove the sorted
function over here.
Since others might have a usecase for an unsorted tuple as well, I'd like to suggest adding a flag to the __init__
method of the Selection
class over here. If there is an interest to implement such a functionality into your package, I could offer to care about a pull request with the mentioned suggestions.
Best regards,
Christian
Hey Christian,
first of all many thanks for this nice package, if I run into you in Seecasino you'll get at least a coffee ;-)
Ah nice, simple-term-menu is used by other Forschungszentrum Jülich employees. 👍 😄
I'd like to use your module for selections where I want to keep track of the selection order. If I understand your code correctly, I could just remove the sorted function over here.
It is a bit more complicated than this: self._selected_menu_indices
is a set
which is an unordered data structure. However, you could replace it with a list
to preserve order and remove the sorted
call as you already mentioned. Additionally, some set
methods have another name on lists (for example add
instead of append
).
Since others might have a usecase for an unsorted tuple as well, I'd like to suggest adding a flag to the init method of the Selection class over here. If there is an interest to implement such a functionality into your package, I could offer to care about a pull request with the mentioned suggestions.
Pull requests are always welcome!
Hi Ingo,
thanks for your answer and the provided suggestions. I'll try to modify the package accordingly and will report about the progress.