Skip to content

Commit f8be2e2

Browse files
authored
gh-108455: peg generator: Use strict_optional=True for grammar_parser (#108629)
1 parent 30305d6 commit f8be2e2

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Tools/peg_generator/mypy.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,5 @@ enable_error_code = truthy-bool,ignore-without-code
1414
warn_return_any = False
1515
warn_unreachable = False
1616

17-
[mypy-pegen.grammar_parser]
18-
strict_optional = False
19-
2017
[mypy-setuptools.*]
2118
ignore_missing_imports = True

Tools/peg_generator/pegen/grammar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def initial_names(self) -> AbstractSet[str]:
349349

350350
Plain = Union[Leaf, Group]
351351
Item = Union[Plain, Opt, Repeat, Forced, Lookahead, Rhs, Cut]
352-
RuleName = Tuple[str, str]
352+
RuleName = Tuple[str, Optional[str]]
353353
MetaTuple = Tuple[str, Optional[str]]
354354
MetaList = List[MetaTuple]
355355
RuleList = List[Rule]

0 commit comments

Comments
 (0)