[New-bugs-announce] [issue37793] argparse uses "container object", should be "iterable"

Eric V. Smith report at bugs.python.org
Thu Aug 8 09:30:55 EDT 2019


New submission from Eric V. Smith <eric at 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 at python
components: Documentation
keywords: newcomer friendly
messages: 349234
nosy: docs at python, eric.smith
priority: normal
severity: normal
status: open
title: argparse uses "container object", should be "iterable"
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37793>
_______________________________________


More information about the New-bugs-announce mailing list