paul j3 added the comment: `parser.set_defaults` lets you set a default for any `dest`. It does not have to be connected with an argument. See what the docs say about using it to set an action linked to a subparser.
`arg1 = parser.add_argument(...)` returns an `Action` object. The parser collects these objects in its lists, but you can also save a reference to it yourself. I'd suggest doing this in an interactive shell, and see for yourself the attributes of this object. Simply doing a 'print' on the object shows a number of the attributes (but not all). It is possible to view, and in some cases, even modify these attributes directly. `args.choices` gives you access to the `choices` attribute. I don't think there's a need for getter/setter methods for Action attributes. The attributes are accessible by normal Python object approaches. p.s. Another forum for asking argparse how-to questions is Stackoverflow. Just tag it 'argparse'. ---------- nosy: +paul.j3 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25035> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com