@@ -897,9 +897,7 @@ PyObject* VM::vectorcall(int ARGC, int KWARGC, bool op_call){
co->name, "() takes ", decl->args.size(), " positional arguments but ", args.size(), " were given"
));
}
- if(!kwargs.empty()){
- TypeError(_S(co->name, "() takes no keyword arguments"));
- }
+ if(!kwargs.empty()) TypeError(_S(co->name, "() takes no keyword arguments"));
s_data.reset(_base + co_nlocals);
int i = 0;
// prepare args
@@ -119,3 +119,24 @@ def f(a=((1,2),3), b=(4,)):
return a, b
assert f() == (((1,2),3), (4,))
+
+def f(a, b):
+ return a + b
+try:
+ f(a=1)
+ exit(1)
+except TypeError:
+ pass
+ f(1)
+ f(1, 2, 3)