diff --git a/lmformatenforcer/characterlevelparser.py b/lmformatenforcer/characterlevelparser.py index 939d8be..db7b4d4 100644 --- a/lmformatenforcer/characterlevelparser.py +++ b/lmformatenforcer/characterlevelparser.py @@ -78,7 +78,7 @@ def get_allowed_characters(self) -> str: def can_end(self) -> bool: return any([parser.can_end() for parser in self.parsers]) - def shortcut_key(self) -> str | None: + def shortcut_key(self) -> Optional[str]: return self.parsers[0].shortcut_key() if len(self.parsers) == 1 else None def cache_key(self) -> Optional[Hashable]: