The signatures are no longer required to match if the only argument to __cinit__ is self.
code.put_init_var_to_py_none(entry, "p->%s")
entry = scope.lookup_here("__new__")
if entry:
+ if entry.trivial_signature:
+ cinit_args = "o, %s, NULL" % Naming.empty_tuple
+ else:
+ cinit_args = "o, a, k"
code.putln(
- "if (%s(o, a, k) < 0) {" %
- entry.func_cname)
+ "if (%s(%s) < 0) {" %
+ (entry.func_cname, cinit_args))
code.put_decref_clear("o", py_object_type);
code.putln(
"}")
elif len(self.args) == 2:
if self.args[1].default is None and not self.args[1].kw_only:
self.entry.signature = TypeSlots.ibinaryfunc
+ elif self.entry.is_special:
+ self.entry.trivial_signature = len(self.args) == 1 and not (self.star_arg or self.starstar_arg)
sig = self.entry.signature
nfixed = sig.num_fixed_args()
for i in range(nfixed):