Extending with new Object types

25381-fields (derek@candyland.gamekeeper.bellcore.com)
17 Aug 1994 13:58:40 GMT

I wrote a note before, but got no reply. I really need some help figuring
out how to extend Python to add new objects.

My example is that I want to create a Database class such that each
object can be called with the methods of the class. The underlying
implementation is in C++.

I have read the documentation and looked at the xxobject.c file as well
as numerous other source files, but am at a loss as to how to connect
Python code with a call to my newDbobject function. I understand how
all the other methods are connected to the class. What I don't understand
is how to instantiate the new object.

Do I need to create a module for the new object as well? I am stumped, since
there are no examples for creating non-builtin objects.

This is critical, because I am evaluating Python along with Elk (a scheme
implementation) as the basis for a large project.

Thanks for the help.

Derek Fields
(derek@cc.bellcore.com)

--
Derek Fields
(derek@gamekeeper.bellcore.com)