diff --git a/lark/parsers/lalr_parser.py b/lark/parsers/lalr_parser.py index 4a504a4f..35820705 100644 --- a/lark/parsers/lalr_parser.py +++ b/lark/parsers/lalr_parser.py @@ -30,7 +30,7 @@ def deserialize(cls, data, memo, callbacks, debug=False): inst.parser = _Parser(inst._parse_table, callbacks, debug) return inst - def serialize(self, memo = None) -> Dict[str, Any]: + def serialize(self, memo: Any = None) -> Dict[str, Any]: return self._parse_table.serialize(memo) def parse_interactive(self, lexer, start): diff --git a/lark/utils.py b/lark/utils.py index 4b7fd8f6..9ad81c8f 100644 --- a/lark/utils.py +++ b/lark/utils.py @@ -172,7 +172,7 @@ def get_regexp_width(expr: str) -> Union[Tuple[int, int], List[int]]: _ID_START = 'Lu', 'Ll', 'Lt', 'Lm', 'Lo', 'Mn', 'Mc', 'Pc' _ID_CONTINUE = _ID_START + ('Nd', 'Nl',) -def _test_unicode_category(s: str, categories: Union[Tuple[str, str, str, str, str, str, str, str], Tuple[str, str, str, str, str, str, str, str, str, str]]) -> bool: +def _test_unicode_category(s: str, categories: Sequence[str]) -> bool: if len(s) != 1: return all(_test_unicode_category(char, categories) for char in s) return s == '_' or unicodedata.category(s) in categories