From 286b89f3ccd5df359edc2b6e5dd3c614e9209878 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sun, 23 Sep 2007 22:12:36 +0200 Subject: [PATCH] another fix to make it work with Robert's signature optimisation --- Cython/Compiler/Nodes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index cd7ab485..029a85d1 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -851,13 +851,15 @@ class DefNode(FuncDefNode): if self.entry.signature is TypeSlots.pyfunction_signature: if len(self.args) == 0: self.entry.signature = TypeSlots.pyfunction_noargs - elif len(self.args) == 1 and self.args[0].default is None: - self.entry.signature = TypeSlots.pyfunction_onearg + elif len(self.args) == 1: + if self.args[0].default is None and not self.args[0].kw_only: + self.entry.signature = TypeSlots.pyfunction_onearg elif self.entry.signature is TypeSlots.pymethod_signature: if len(self.args) == 1: self.entry.signature = TypeSlots.unaryfunc - elif len(self.args) == 2 and self.args[1].default is None: - self.entry.signature = TypeSlots.ibinaryfunc + elif len(self.args) == 2: + if self.args[1].default is None and not self.args[1].kw_only: + self.entry.signature = TypeSlots.ibinaryfunc sig = self.entry.signature nfixed = sig.num_fixed_args() for i in range(nfixed): -- 2.26.2