Chris Jerdonek added the comment: > Does argparse actually convert (x)range objects to a list or set (the help > indicates the latter) for internal use?
No, it leaves the provided choices argument as is. Here is what the documentation says argparse accepts: "Any object that supports the *in* operator can be passed as the choices value, so dict objects, set objects, custom containers, etc. are all supported." And here is the code for testing containment: http://hg.python.org/cpython/file/ee7b713fec71/Lib/argparse.py#l2284 Terry, are you okay with the proposed documentation patch? Special-casing the display of range values seems like an enhancement request to me rather than a bug. I would suggest that be handled as an enhancement request targeted initially for Python 3.4. I would be happy to create a new issue for that. Alternatively, it could be considered as a second patch on this issue. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue16418> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com