[issue34827] Make argparse.NameSpace iterable
Serhiy Storchaka
report at bugs.python.org
Fri Sep 28 02:08:56 EDT 2018
Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:
issue8982 is not about making argparse.Namespace iterable, it is about better documenting it.
issue8979 was rejected for several reasons which are still valid.
For making **args working, args shouldn't be iterable, it should have the keys() method. And this will conflict with the --keys option.
Python is not a JavaScript. Objects and dictionaries are different things here. If you want to convert argparse.Namespace to dict, vars(args) is the One Obvious Way. It is officially documented.
----------
nosy: +serhiy.storchaka
resolution: -> rejected
stage: -> resolved
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34827>
_______________________________________
More information about the Python-bugs-list
mailing list