New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Argparse choices should be a sequence #92446
Comments
180909
added a commit
to 180909/cpython
that referenced
this issue
May 8, 2022
rhettinger
pushed a commit
that referenced
this issue
May 13, 2022
Actually, the linked pr changes refer to |
On a quick review I'd also say that the change to A |
This was referenced Jul 6, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rhettinger commentedMay 8, 2022
Documentation
Instead of saying "any container" is supported, refer only to "sequences".
Technically, a Container is only required to support
__contains__
which is insufficent for argparse. Also, a sets do get accepted are a bad choice because the order shown in help and usage is non-deterministic. So, Sequence is the only reasonable choice because we need sizing and ordered iteration.The text was updated successfully, but these errors were encountered: