diff --git a/Tools/peg_generator/mypy.ini b/Tools/peg_generator/mypy.ini index 6a45165e8ee..3f3db2ea126 100644 --- a/Tools/peg_generator/mypy.ini +++ b/Tools/peg_generator/mypy.ini @@ -14,8 +14,5 @@ enable_error_code = truthy-bool,ignore-without-code warn_return_any = False warn_unreachable = False -[mypy-pegen.grammar_parser] -strict_optional = False - [mypy-setuptools.*] ignore_missing_imports = True diff --git a/Tools/peg_generator/pegen/grammar.py b/Tools/peg_generator/pegen/grammar.py index 03d60d01026..fcf868eb175 100644 --- a/Tools/peg_generator/pegen/grammar.py +++ b/Tools/peg_generator/pegen/grammar.py @@ -349,7 +349,7 @@ class Cut: Plain = Union[Leaf, Group] Item = Union[Plain, Opt, Repeat, Forced, Lookahead, Rhs, Cut] -RuleName = Tuple[str, str] +RuleName = Tuple[str, Optional[str]] MetaTuple = Tuple[str, Optional[str]] MetaList = List[MetaTuple] RuleList = List[Rule]