Message198314
Yup, just trying to add some explanation on how it currently works.
Drekin, I'm sure you've already figured this out, but for those who may read this in the future: what you need is a helper function:
def OptionalEnum(value):
"could also be OptionalEnum(enum, value)"
try:
return SomeEnum(value) # or return enum(value)
except ValueError:
return value |
|
Date |
User |
Action |
Args |
2013-09-23 04:04:07 | ethan.furman | set | recipients:
+ ethan.furman, barry, eli.bendersky, docs@python, Drekin |
2013-09-23 04:04:06 | ethan.furman | set | messageid: <1379909046.99.0.844905213611.issue19040@psf.upfronthosting.co.za> |
2013-09-23 04:04:06 | ethan.furman | link | issue19040 messages |
2013-09-23 04:04:06 | ethan.furman | create | |
|