aisk / pick

create curses based interactive selection list in the terminal
MIT License
721 stars 60 forks source link

Excluded indexes #132

Closed iamalisalehi closed 3 weeks ago

iamalisalehi commented 1 month ago

New PR to implement changes requested by @J3ldo and my suggestions discussed in PR #105 . This PR also resolves Issue #29 .

iamalisalehi commented 1 month ago

Hi @aisk , a couple of questions: Should I write a new test for excluded indexes? What about a new example?

aisk commented 1 month ago

Hi @aisk , a couple of questions: Should I write a new test for excluded indexes? What about a new example?

Thanks for the PR! Test and example will be appreciated.

iamalisalehi commented 1 month ago

Thanks for the comment @aisk , I think the PR is better now, but I'm not sure whether I raised the right error on line 59 or not.

aisk commented 1 month ago

Thanks for the comment @aisk , I think the PR is better now, but I'm not sure whether I raised the right error on line 59 or not.

As Python's document said https://docs.python.org/3/library/exceptions.html#ValueError:

Raised when an operation or function receives an argument that has the right type but an inappropriate value, and the situation is not described by a more precise exception such as IndexError.

ValueError is the best choice in this case.

aisk commented 3 weeks ago

Thanks for contributing!