New submission from Eric V. Smith <e...@trueblade.com>:

https://docs.python.org/3/library/argparse.html#choices says "These can be 
handled by passing a container object as the choices keyword argument to 
add_argument()".

I think this should be "iterable" instead. Internally, argparse reads the 
iterable and converts it to a list so that it can read it multiple times (among 
other reasons, I'm sure). One of the examples uses range(), which is not a 
container.

"container" is also used in 
https://docs.python.org/3/library/argparse.html#the-add-argument-method

Bonus points for fixing the docstring in argparse.py. I didn't check if 
anywhere else in that file needs to be fixed.

----------
assignee: docs@python
components: Documentation
keywords: newcomer friendly
messages: 349234
nosy: docs@python, eric.smith
priority: normal
severity: normal
status: open
title: argparse uses "container object", should be "iterable"
versions: Python 3.8

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

Reply via email to