This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author paul.j3
Recipients Sworddragon, paul.j3, r.david.murray
Date 2015-09-10.04:24:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1441859048.13.0.541137568155.issue25035@psf.upfronthosting.co.za>
In-reply-to
Content
`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.
History
Date User Action Args
2015-09-10 04:24:08paul.j3setrecipients: + paul.j3, r.david.murray, Sworddragon
2015-09-10 04:24:08paul.j3setmessageid: <1441859048.13.0.541137568155.issue25035@psf.upfronthosting.co.za>
2015-09-10 04:24:08paul.j3linkissue25035 messages
2015-09-10 04:24:07paul.j3create