def sex(self, value: str): """Set holder's genre Can be used 'F' (female), 'M' (male) or 'X' (undefined). Case insensitive. """ self._sex = check.sex(value)
def sex(self, value: str): """Set holder's genre Can be used 'F' (female), 'M' (male) or undefined. Case insensitive. """ value = value if value not in "Xx" else "<" self._sex = check.sex(value)
def sex(self) -> bool: """Return True if the sex is "M", "F" or "X", False otherwise.""" ok = False try: ok = bool(check.sex(self._sex)) except ValueError: pass finally: return self._report("valid genre format", ok)