Movatterモバイル変換
[0]ホーム
CXX extension types question
Greg LandrumgReGlAnDrUm at earthlink.net
Sat Apr 28 16:07:50 EDT 2001
I'm working on wrapping a series of C++ classes using CXX. I'm using a CVSpull of CXX (because I wanted the updated examples + the VisualC projectfiles). In case it makes any difference, I'm using Python2.0 and workingunder Win2K.Things were going swimmingly (CXX is really quite convenient), but I haverun up against a little wall and was hoping someone could tell me how toclimb it.I've got a single extension module which defines a number of extension types(PyAtom, PyMol, PyBond, etc.), the problem arises when I want to callmethods of one extension type using arguments of another type.For example, PyBond has a method FindOtherAtom which takes a PyAtom as anargument. I've got:Py::Object PyBond::FindOtherAtom(const Py::Tuple& args){ Py::Object o(args[0]); // other crap}The problem I'm having is converting o (the Py::Object) into a PyAtom (orusing some other method of getting the PyAtom from the args). I've tried anumber of ways of doing this, but they've pretty much all failed.Does anyone have any advice on how to handle this? A pointer to a moreappropriate destination for the question would also be welcomed.Thanks,-greg
More information about the Python-listmailing list
[8]ページ先頭