we already have some non-recursive solutions here.
import argparse
args = argparse.Namespace()
args.foo = 1
args.bar = [1,2,3]
args.c = argparse.Namespace()
args.c.foo = 'a'
d = vars(args)
>>> d
{'foo': 1, 'bar': [1, 2, 3], 'c': Namespace(foo='a')}
The problem is if a second-level entry is also a Namespace, what we actually get is a dict of Namespace.
The question is if there is a handy recursive solution that is ready for us.