Eric V. Smith added the comment:

Isn't this really just an inappropriate use of a string instead of a list? If 
indeed this is in the documentation, it should be changed.

I still don't like:
>>> p.add_argument('a', choices=list('abc'))
but at least it would work.

This call to list() could be done internally, but I think passing in a string 
is a bad practice and argparse should not contain internal workarounds to cater 
to this usage.

If you're proposing that argparse should use sequence iteration instead of the 
"in" operator, I disagree with that solution.

----------
nosy: +eric.smith

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

Reply via email to