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 barry, bethard, desbma, leycec, paul.j3, rhettinger
Date 2016-04-12.05:42:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460439769.37.0.850434993785.issue25061@psf.upfronthosting.co.za>
In-reply-to
Content
desbma:

Rereading your latest code and comment:

> * The meaning of the 'type' parameter for StoreEnumAction is somewhat different than for other actions (enum class vs callable that validates)

it occurred to me that that parameter does not have to be named 'type'.  It could just as well be 'enumClass' or something else.  It's just local to the class __init__ method.

Something that's come up with other Action classes is that the parameter list is not well documented.  While there's a generic set of parameters, the subclasses vary in what they accept or require or ignore.  The docs don't elaborate, and the error messages can be cryptic.  A new class with a new parameter (whether new in name or meaning) can add to that confusion.

We need to think more abstractly, so we aren't just improving the handling of 'enums', but also all their derived and meta classes.  And possibly other mappings, where we want to do a 'key' lookup, and form help strings of the choices.
History
Date User Action Args
2016-04-12 05:42:49paul.j3setrecipients: + paul.j3, barry, rhettinger, bethard, desbma, leycec
2016-04-12 05:42:49paul.j3setmessageid: <1460439769.37.0.850434993785.issue25061@psf.upfronthosting.co.za>
2016-04-12 05:42:49paul.j3linkissue25061 messages
2016-04-12 05:42:48paul.j3create