Thr basic idea is that you add methods to the new module to
_create_ your new data type. Creating the instance itself is done via
the NEWOBJ macro. You will need a "Type" object for _both_ the module
and the new data type.
So the main module creates and returns a new instance of your data type.
Conceivable, this may be the only method in your module.
Then, you create methods for your data type. Once an object has been created
and returned to Python, you can use its methods.
Sample Python code may look like:
newobj = yourmodule.CreateObject()
newobj.SomeMethod()
Ther best sample code for this sort of stuff (specifically the object methods)
is probably inside some of the core modules - look maybe at socketmodule.
{I think the above is correct - that is what I do anyway. Hopefully someone will pipe up with a better answer if one exists}
HTH...
Mark.