From ec282e1a9035b54749e62d0bc5be3acc2d7b1f10 Mon Sep 17 00:00:00 2001 From: August Karlstedt Date: Sun, 24 Mar 2024 19:53:54 -0700 Subject: [PATCH] annotate ParserElement kwargs (#551) * Update core.py * Update core.py --- pyparsing/core.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pyparsing/core.py b/pyparsing/core.py index 3bbeb8ac..a9141005 100644 --- a/pyparsing/core.py +++ b/pyparsing/core.py @@ -607,7 +607,7 @@ def breaker(instring, loc, doActions=True, callPreParse=True): self._parse = self._parse._originalParseMethod # type: ignore [attr-defined, assignment] return self - def set_parse_action(self, *fns: ParseAction, **kwargs) -> "ParserElement": + def set_parse_action(self, *fns: ParseAction, **kwargs: Any) -> "ParserElement": """ Define one or more actions to perform when successfully matching parse element definition. @@ -695,7 +695,7 @@ def is_valid_date(instring, loc, toks): return self - def add_parse_action(self, *fns: ParseAction, **kwargs) -> "ParserElement": + def add_parse_action(self, *fns: ParseAction, **kwargs: Any) -> "ParserElement": """ Add one or more parse actions to expression's list of parse actions. See :class:`set_parse_action`. @@ -707,7 +707,7 @@ def add_parse_action(self, *fns: ParseAction, **kwargs) -> "ParserElement": ) return self - def add_condition(self, *fns: ParseCondition, **kwargs) -> "ParserElement": + def add_condition(self, *fns: ParseCondition, **kwargs: Any) -> "ParserElement": """Add a boolean predicate function to expression's list of parse actions. See :class:`set_parse_action` for function call signatures. Unlike ``set_parse_action``, functions passed to ``add_condition`` need to return boolean success/fail of the condition.