"Stefan Behnel" <python_capi(a)behnel.de> writes:
> Hrvoje Niksic wrote:
>> Stefan Behnel writes:
>>> pycnweb wrote:
>>>> I am now writing a python extension, but I confuse with the reference.
>>>
>>> If you care more about working code than fighting confusion, Cython
>>> might be worth a look.
>>
>> Stefan, please stop doing this. This list is about helping people
>> using Python/C, not Cython advocacy.
>
…
[View More]> Where is the difference?
The point is that statements like the above don't help someone who
*wants* (for whatever reason) to learn Python/C. It's perfectly fine
to mention Cython as a viable alternative, but not to imply that
Python/C is somehow non-functional or that it doesn't result in
working code. It's like posting to a C newsgroup telling everyone to
use C++ because it's so much better. It may well be better, but there
are good reasons why there are separate C and C++ forums.
comp.lang.python is a much more appropriate venue for Cython (or
boost.python, or PyCXX) advocacy.
[View Less]
Hi All,
I am now writing a python extension, but I confuse with the reference.
PyTuple_SetItem and PyList_SetItem will steal a reference from item. So
PyTuple_SetItem(pTuple, 2, Py_BuildValue("s", "Python"))
PyList_SetItem(pList, i, Py_BuildValue("i", i))
will not cause a memory leak. But
PyList_Insert(pList, 2, Py_BuildValue("s", "inserted"))
PyList_Append(pList, Py_BuildValue("s", "appended"))
PyDict_SetItemString(pDict, "second", Py_BuildValue("f", 3.14f))
will cause a memory leak.
…
[View More]Am I right?
Thanks.
[View Less]