[issue34827] Make argparse.NameSpace iterable

2018-09-28 Thread paul j3
paul j3 added the comment: As documented in https://docs.python.org/3/library/argparse.html#the-namespace-object you can create your own 'namespace' class, that does everything you want and more. argparse makes very few assumptions about the object - using getattr, setattr, and hasattr whe

[issue34827] Make argparse.NameSpace iterable

2018-09-27 Thread Serhiy Storchaka
Serhiy Storchaka 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 th

[issue34827] Make argparse.NameSpace iterable

2018-09-27 Thread Micheal Taylor
New submission from Micheal Taylor : There was an issue to make argparse.Namespace iterable with a specific intent on being able to convert it to a dictionary (https://bugs.python.org/issue8982). Additionally there was another improvement request to make it accessible like a dictionary. (h