| 22 | Cache = {} # type: Dict[int, Optional[Sequence[Optional[str]]]] |
| 23 | |
| 24 | class UnidecodeError(ValueError): |
| 25 | def __init__(self, message: str, index: Optional[int] = None) -> None: |
| 26 | """Raised for Unidecode-related errors. |
| 27 | |
| 28 | The index attribute contains the index of the character that caused |
| 29 | the error. |
| 30 | """ |
| 31 | super(UnidecodeError, self).__init__(message) |
| 32 | self.index = index |
| 33 | |
| 34 | |
| 35 | def unidecode_expect_ascii(string: str, errors: str = 'ignore', replace_str: str = '?') -> str: |