Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

annotate ParserElement kwargs #551

Merged
merged 2 commits into from Mar 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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