paul j3 added the comment:

On Stackoverflow a couple of posters have asked about nesting namespaces as a 
way of separating the parser and subparser arguments.

http://stackoverflow.com/questions/15782948
http://stackoverflow.com/questions/18668227

One solution that I rather like http://stackoverflow.com/a/18709860/901925

uses a custom Namespace class that recognizes a 'dest' like

    p.add_argument('--deep', dest='test.doo.deep')

and produces

    Nestedspace(foo='test', test=Nestedspace(bar='baz', 
doo=Nestedspace(deep='doodod')))

I wonder if a simplified version of this could be added to the Namespace 
section in the documentation.

There are 2 sides to the name conflict issue:

- what control does the programmer have over names (esp. when using [parents] 
and subparsers)?

- how does the programmer want to access the arguments in the resulting 
namespace?

----------

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

Reply via email to