asweigart / asweigart/pyinputplus

pyinputplus error with multiple values for arguments

Open
#34 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
114
Forks
19
PR merge metrics
No merged PRs in 30d

Description

if i try to create input values as a list, it wont function.
E.g. Typing 'c' works, but typing 'a' or 'b' gives an error message.

import pyinputplus as pyip

while True:
prompt = 'Do you want to know how to keep an idiot busy?\n'

response = pyip.inputYesNo(prompt, yesVal=['a', 'b'], noVal='c')

if response == 'a':
print('Ok, this is how you keep an idiot busy !')
break

if response == 'c':
print('Oh well then, have a nice day.')
break

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the inputYesNo entry point and reproduce the issue with the example using yesVal=['a', 'b'] and noVal='c'. Trace how multiple yes values are validated and confirm that both 'a' and 'b' are accepted while 'c' remains the no value.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.