From 96957116883f91a3ae7b92f1be3a91aac4dfdea3 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 28 Jul 2010 09:50:55 +0200 Subject: [PATCH] comments --- Cython/Compiler/Nodes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 6069072c..a02629f7 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2603,10 +2603,12 @@ class DefNode(FuncDefNode): code.putln("Py_ssize_t kw_args = PyDict_Size(%s);" % Naming.kwds_cname) - # it looks funny to separate the init-to-0 from setting the - # default value, but C89 needs this + # the 'values' array collects borrowed references to arguments + # before doing any type coercion etc. code.putln("PyObject* values[%d] = {%s};" % ( max_args, ','.join('0'*max_args))) + # it looks funny to separate the init-to-0 from setting the + # default value, but C89 needs this for i, default_value in default_args: code.putln('values[%d] = %s;' % (i, default_value)) -- 2.26.2