dealloc function in python extend c module

2009-07-02 Thread Shen, Yu-Teh
I create my extend type something like http://www.python.org/doc/current/extending/newtypes.html. And my type has a member which is a pointer point to my allocate memory ( no ref count). ex: --- typedef struct { PyObject_HEAD /*

Re: dealloc function in python extend c module

2009-07-02 Thread Philip Semanchuk
On Jul 2, 2009, at 2:11 AM, Shen, Yu-Teh wrote: I create my extend type something like http://www.python.org/doc/current/extending/newtypes.html . And my type has a member which is a pointer point to my allocate memory ( no ref count). ex: ---

Re: dealloc function in python extend c module

2009-07-02 Thread Gabriel Genellina
En Thu, 02 Jul 2009 14:22:53 -0300, Philip Semanchuk phi...@semanchuk.com escribió: On Jul 2, 2009, at 2:11 AM, Shen, Yu-Teh wrote: I create my extend type something like http://www.python.org/doc/current/extending/newtypes.html. And my type has a member which is a pointer point to my

Re: dealloc function in python extend c module

2009-07-02 Thread Philip Semanchuk
On Jul 2, 2009, at 9:28 PM, Gabriel Genellina wrote: En Thu, 02 Jul 2009 14:22:53 -0300, Philip Semanchuk phi...@semanchuk.com escribió: Hi Shen, I'm no expert on Python memory management, but since no once else has answered your question I'll tell you what I *think* is happening. Python

python extend c++ module

2009-06-30 Thread Shen, Yu-Teh
I have written a c++ extend module and I use distutils to build. setup.py from distutils.core import setup, Extension setup(name=noddy, version=1.0, ext_modules=[ Extension(noddy3, [noddy3.cpp, a.cpp]) ]) I found it's quite strange when compiling. I

python extend c++ module

2009-06-29 Thread ���m�ۤv...@����
I have written a c++ extend module and I use distutils to build. setup.py from distutils.core import setup, Extension setup(name=noddy, version=1.0, ext_modules=[ Extension(noddy3, [noddy3.cpp, a.cpp]) ]) I found it's quite strange when compiling. I

Re: python extend c++ module

2009-06-29 Thread Christian Heimes
找尋自己的一片天 schrieb: I found it's quite strange when compiling. I didn't use extern C at all , how can python get the right c++ funciton name without any compile error?? I found that it first use gcc to compile noddy3.cpp and then link by g++. Could anyone explain what it's all about? The