Chris Jerdonek added the comment:

> argparse does not require that choices be iterable, as it *does* use 'in', as 
> it should. Line 2274:
>        if action.choices is not None and value not in action.choices:

There are cases where it's incorrect for argparse to being using "in" instead 
of sequence iteration, which again leads me to think that iteration is what was 
intended.  See issue 16977.

> So unless the usage message is generated even when not needed (I did not 
> delve that far), non-iterables should work now as long as the user does not 
> request the usage message or make an input mistake.

As I said in the second comment of this issue, this doesn't work in any case 
because the ValueError is raised on add_argument().  So I don't see how the 
lack of this option can be affecting any users.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue16468>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to