예제 #1
0
파일: _fields.py 프로젝트: yoshikichi/mrz
    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)
예제 #2
0
    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)
예제 #3
0
파일: _fields.py 프로젝트: yoshikichi/mrz
    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)