Need help wrting classes/methods in C

Mark Hammond (MHammond@cmutual.com.au)
Fri, 17 Jun 1994 00:12:06 GMT

Hi all,
I have been playing around with extending Python. I have read the
docs, and I am fairly certain this question goes beyond them.

I can successfully build functions in C, and have them built and
imported. This works fine.

But now, I want to write _methods_ in C, and have some questions.

* Should I define the class in Python before importing my module, or
should I define the class itself in 'C'. If in 'C', how do I do this?
Are there any samples of this?

* Once I have my class defined, how do I attach a C function to the
class as a method? The inittab[] is the link from function<->module, but
I cant see anything too similar for classes.

* Can I define attributes/member vars/whatever you call them as C
variables, rather than Python objects. ie, can I put a native (say)
pointer as a member variable (only to be accessed by the C code, of
course)

Any advice, or pointers to docs/archives etc would be appreciated, by
EMail or post.

Thanks in advance...

Mark.