]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-108455: peg generator: Use `strict_optional=True` for `grammar_parser` (#108629)
authorNikita Sobolev <mail@sobolevn.me>
Tue, 29 Aug 2023 12:02:52 +0000 (15:02 +0300)
committerGitHub <noreply@github.com>
Tue, 29 Aug 2023 12:02:52 +0000 (13:02 +0100)
Tools/peg_generator/mypy.ini
Tools/peg_generator/pegen/grammar.py

index 6a45165e8eecb5e86ea6b6cb69326ab941e859d7..3f3db2ea1266c68b70d6248ca5ff84a85a806007 100644 (file)
@@ -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
index 03d60d01026f851b21fbb9c60c35e112f14a181a..fcf868eb1753e5b38624e4c5e22eeedeea4d5dd4 100644 (file)
@@ -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]