   Instantiating new PyObject with Python C API [SOLVED]
  I'm trying to teach myself how to extend and embed Python with C by creating a simple class for representing vectors.  Some of the methods I'm creating (such as the cross product) will need to return a new instance of the vector class.  I've been searching Google and the Python documentation for a few hours, but I can't seem to figure out how to do this.  the closest thing I can find to this is Py_BuildValue, but I think that that only works for PyObjects if I already have an instance of the same class.Does anyone know how to do this?[Edited by - lol on May 13, 2009 9:11:03 PM]
  Never mind, I finally managed to figure it out on my own.Just in case anyone else has this same problem and comes across this thread, here's a link to a page with the functions necessary to do this:http://docs.python.org/c-api/allocation.html   