Skip to content

Commit

Permalink
annotate ParserElement kwargs (#551)
Browse files Browse the repository at this point in the history
* Update core.py

* Update core.py
  • Loading branch information
AugustKarlstedt committed Mar 25, 2024
1 parent f26e006 commit ec282e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyparsing/core.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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`.
Expand All @@ -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.
Expand Down

0 comments on commit ec282e1

Please sign in to comment.