def _validate_current(self, proposal): if proposal.value not in self.values: raise TraitError("Current value not part of the values.") return proposal.value