[SciPy-dev] Problem solved ---- Sorry!
eric at scipy.org
Wed Jan 30 11:58:59 CST 2002
> I calld inline with arguments taht were not used in the code...
> That caused the error .... :-(
> Bug or feature? :-)
The way weave is written, it views the C code as a continuation of the Python code, not really a function call, so the same variables are used in both. There might be a way around it. It would incur an efficiency hit, though I think very small. A bigger issue is that it could be confusing. For example:
a,b,c,d,e = 1,1,1,1,1
code = """
return_val = Py::new_reference_to(Py::Int(a+b+c+d));
In the second version, are the argument names substituted positionally or by name? If we go with positional, then the idea of the C/C++ code being a continuation of the python code is "broken", and this becomes more of a function call.
Of course the current behavior was confusing to you, so maybe it is 6 one way and half a dozen the other... :)
Eventually, I'd like to remove the need to specify the argument list. This would require some C/C++ parsing of the code string to find the necessary arguments.
If your interested in more of a function calling approach, for now, take a look at weave.ext_tools. It builds extension functions that are called in the "normal" way.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Scipy-dev