[issue16468] argparse only supports iterable choices

Brendan Barnwell report at bugs.python.org
Sun Aug 18 20:49:47 EDT 2019


Brendan Barnwell <brenbarn at brenbarn.net> added the comment:

Here is an example of someone who cares about the behavior and/or the documentation (and still cares enough to check up on their StackOverflow question six years later): https://stackoverflow.com/questions/13833566/python-argparse-choices-from-an-infinite-set/13833736 .

The issue is not the use of the word "container".  The docs literally say "Any object that supports the `in` operator can be passed as the choices value" and that is not true.  In fact, changing it to say "any container type" would be an improvement as that is at least arguably correct, whereas the current documentation is unambiguously incorrect.

----------
versions:  -Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue16468>
_______________________________________


More information about the Python-bugs-list mailing list