Return whether a value matches one of the enumeration options
(self, e)
| 589 | return desc |
| 590 | |
| 591 | def in_values(self, e): |
| 592 | """ |
| 593 | Return whether a value matches one of the enumeration options |
| 594 | """ |
| 595 | is_str = isinstance(e, str) |
| 596 | for v, regex in zip(self.values, self.val_regexs): |
| 597 | if is_str and regex: |
| 598 | in_values = fullmatch(regex, e) is not None |
| 599 | # in_values = regex.fullmatch(e) is not None |
| 600 | else: |
| 601 | in_values = e == v |
| 602 | |
| 603 | if in_values: |
| 604 | return True |
| 605 | |
| 606 | return False |
| 607 | |
| 608 | def validate_coerce(self, v): |
| 609 | if is_none_or_typed_array_spec(v): |
no test coverage detected