mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
gh-90370: Argument Clinic: avoid temporary tuple creation for varargs (#126064)
Avoid temporary tuple creation when all arguments either positional-only or vararg. Objects/setobject.c and Modules/gcmodule.c adapted. This fixes slight performance regression for set methods, introduced by gh-115112.
This commit is contained in:
parent
d07dcce693
commit
8c22eba877
11 changed files with 209 additions and 222 deletions
|
@ -3381,8 +3381,8 @@ class ClinicFunctionalTest(unittest.TestCase):
|
|||
def test_varpos(self):
|
||||
# fn(*args)
|
||||
fn = ac_tester.varpos
|
||||
self.assertEqual(fn(), ())
|
||||
self.assertEqual(fn(1, 2), (1, 2))
|
||||
self.assertEqual(fn(), ((),))
|
||||
self.assertEqual(fn(1, 2), ((1, 2),))
|
||||
|
||||
def test_posonly_varpos(self):
|
||||
# fn(a, b, /, *args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue