Ethan Furman added the comment:
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
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue19040>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com