Skip to content

Commit 2d5e594

Browse files
committed
pythongh-108455: Use strict_optional=True for grammar_parser
1 parent c879b9f commit 2d5e594

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

Tools/peg_generator/mypy.ini

-3
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,5 @@ strict = True
1313
warn_return_any = False
1414
no_implicit_reexport = False
1515

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

Tools/peg_generator/pegen/grammar.py

+1-1
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)