summaryrefslogtreecommitdiff
path: root/pyparsing/core.py
diff options
context:
space:
mode:
authorptmcg <ptmcg@austin.rr.com>2022-03-24 18:40:48 -0500
committerptmcg <ptmcg@austin.rr.com>2022-03-24 18:40:48 -0500
commit4f984635d1b23135009ad4d4116e97a445a7e28c (patch)
tree6a80153cac019b61a3653178c8d0c5e61f894ee1 /pyparsing/core.py
parent1a40d172927e46813cd8a948725bd27ac8714d52 (diff)
downloadpyparsing-git-4f984635d1b23135009ad4d4116e97a445a7e28c.tar.gz
Add tests and updated docs for changes to lpar and rpar args to infix_notation; add grouping of non-suppressed tokens with grouped contents
Diffstat (limited to 'pyparsing/core.py')
-rw-r--r--pyparsing/core.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/pyparsing/core.py b/pyparsing/core.py
index af66c04..0d1ca6f 100644
--- a/pyparsing/core.py
+++ b/pyparsing/core.py
@@ -262,7 +262,7 @@ printables = "".join([c for c in string.printable if c not in string.whitespace]
_trim_arity_call_line: traceback.StackSummary = None
-def _trim_arity(func, maxargs=2):
+def _trim_arity(func, max_limit=3):
"""decorator to trim function calls to match the arity of the target"""
global _trim_arity_call_line
@@ -306,7 +306,7 @@ def _trim_arity(func, maxargs=2):
del tb
if trim_arity_type_error:
- if limit <= maxargs:
+ if limit < max_limit:
limit += 1
continue
@@ -317,6 +317,7 @@ def _trim_arity(func, maxargs=2):
# (can't use functools.wraps, since that messes with function signature)
func_name = getattr(func, "__name__", getattr(func, "__class__").__name__)
wrapper.__name__ = func_name
+ wrapper.__doc__ = func.__doc__
return wrapper