This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.smith
Recipients chris.jerdonek, eric.smith
Date 2013-01-17.14:55:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1358434506.39.0.762354367644.issue16977@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-01-17 14:55:06eric.smithsetrecipients: + eric.smith, chris.jerdonek
2013-01-17 14:55:06eric.smithsetmessageid: <1358434506.39.0.762354367644.issue16977@psf.upfronthosting.co.za>
2013-01-17 14:55:06eric.smithlinkissue16977 messages
2013-01-17 14:55:05eric.smithcreate