[pypy-commit] pypy py3.7-call-changes: what I actually wanted to achieve: support calls with arbitrary many arguments

cfbolz pypy.commits at gmail.com
Thu Jan 16 07:31:22 EST 2020


Author: Carl Friedrich Bolz-Tereick <cfbolz at gmx.de>
Branch: py3.7-call-changes
Changeset: r98544:8169d516e6b1
Date: 2020-01-16 13:30 +0100
http://bitbucket.org/pypy/pypy/changeset/8169d516e6b1/

Log:	what I actually wanted to achieve: support calls with arbitrary many
	arguments

diff --git a/pypy/interpreter/astcompiler/astbuilder.py b/pypy/interpreter/astcompiler/astbuilder.py
--- a/pypy/interpreter/astcompiler/astbuilder.py
+++ b/pypy/interpreter/astcompiler/astbuilder.py
@@ -1111,8 +1111,6 @@
                 (generator_count and (keyword_count or arg_count)):
             self.error("Generator expression must be parenthesized "
                        "if not sole argument", args_node)
-        if arg_count + keyword_count + generator_count > 255:
-            self.error("more than 255 arguments", args_node)
         args = []
         keywords = []
         used_keywords = {}
diff --git a/pypy/interpreter/astcompiler/test/test_compiler.py b/pypy/interpreter/astcompiler/test/test_compiler.py
--- a/pypy/interpreter/astcompiler/test/test_compiler.py
+++ b/pypy/interpreter/astcompiler/test/test_compiler.py
@@ -1333,12 +1333,17 @@
         res = "+".join(args)
         callargs = ", ".join(str(i) for i in range(300))
 
-        source = """def f(%s):
+        source1 = """def f(%s):
+            return %s
+x = f(%s)
+        """ % (argdef, res, callargs)
+        source2 = """def f(%s):
             return %s
 x = f(*(%s))
         """ % (argdef, res, callargs)
 
-        yield self.simple_test, source, 'x', sum(range(300))
+        yield self.simple_test, source1, 'x', sum(range(300))
+        yield self.simple_test, source2, 'x', sum(range(300))
 
 
 class TestCompilerRevDB(BaseTestCompiler):


More information about the pypy-commit mailing list