Ive been learning the C-API lately so I can write python extensions for some of 
my c++ stuff.

I want to use the new and delete operators for creating and destroying my 
objects.

The problem is python seems to break it into several stages. tp_new, tp_init 
and tp_alloc for creation and tp_del, tp_free and tp_dealloc for destruction. 
However c++ just has new which allocates and fully constructs the object and 
delete which destructs and deallocates the object.


Which of the python tp_* methods do I need to provide and what must they do to 
be compatible with python subclassing.

Also I want to be able to create the object directly in c++ eg "PyObject *obj = 
new MyExtensionObject(args);"



_________________________________________________________________
Love Hotmail?  Check out the new services from Windows Live! 
http://clk.atdmt.com/UKM/go/132630768/direct/01/
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to