Message250577
I would like the enum type to be stored directly.
With your approach, the user does not know what are the possible choices, until he/she tries a invalid value and get the exception. If I pass the enum type to the choice parameter, the help message is not very user friendly ("<CustomEnumType.VAL1: 1>"...) and does not accurately represent possible input strings.
Anyway, my first example snippet works and does what I need, but it feels a bit like a hack.
In my opinion this is a classic use case for enums, that should be handled more naturally by the argparse module. |
|
Date |
User |
Action |
Args |
2015-09-13 17:13:37 | desbma | set | recipients:
+ desbma, barry, paul.j3 |
2015-09-13 17:13:37 | desbma | set | messageid: <1442164417.61.0.511762807963.issue25061@psf.upfronthosting.co.za> |
2015-09-13 17:13:37 | desbma | link | issue25061 messages |
2015-09-13 17:13:37 | desbma | create | |
|