bpo-37122: Make co->co_argcount represent the total number of positonal arguments in the code object (GH-13726)
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 91008c0..0d80af4 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -112,7 +112,7 @@
>>> dump(posonly_args.__code__)
name: posonly_args
-argcount: 1
+argcount: 3
posonlyargcount: 2
kwonlyargcount: 0
names: ()
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 1561021..652af45 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -640,7 +640,7 @@
code_info_tricky = """\
Name: tricky
Filename: (.*)
-Argument count: 3
+Argument count: 5
Positional-only arguments: 2
Kw-only arguments: 3
Number of locals: 10
diff --git a/Lib/test/test_positional_only_arg.py b/Lib/test/test_positional_only_arg.py
index 0aaad84..59b0b8f 100644
--- a/Lib/test/test_positional_only_arg.py
+++ b/Lib/test/test_positional_only_arg.py
@@ -100,14 +100,14 @@
def f(a, b, c, /, d, e=1, *, f, g=2):
pass
- self.assertEqual(2, f.__code__.co_argcount) # 2 "standard args"
+ self.assertEqual(5, f.__code__.co_argcount) # 3 posonly + 2 "standard args"
self.assertEqual(3, f.__code__.co_posonlyargcount)
self.assertEqual((1,), f.__defaults__)
def f(a, b, c=1, /, d=2, e=3, *, f, g=4):
pass
- self.assertEqual(2, f.__code__.co_argcount) # 2 "standard args"
+ self.assertEqual(5, f.__code__.co_argcount) # 3 posonly + 2 "standard args"
self.assertEqual(3, f.__code__.co_posonlyargcount)
self.assertEqual((1, 2, 3), f.__defaults__)