paul j3 added the comment: `get_default` and `set_defaults` are parser methods, and do more than set or get a particular Action attribute. 'Set' for example changes both the 'parser._defaults' attribute, and a 'action.default' attribute. Defaults are complex and can be defined in at least 3 different ways.
'choices' (and other things like 'required', 'nargs', even 'default') is an attribute of a specific Action (argument object). You normally only set these in one way, as parameters of the `add_argument` method. 'action.default' and 'action.choices' are 'public' attributes. 'parser._defaults' is a 'private' attribute. A setter method is the right way to change a 'private' attribute (if needed). It usually isn't need for a 'public' one. ---------- _______________________________________ 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