I'm trying to support this notation in python:
something = record["somefieldname"]
I had that working with the Python C API, by implementing the len and
getitem functions, setting them in the PyTypeObject::tp_as_mapping
struct field.
I'm now trying to do this with boost::python, like so, because googling
has suggested that this should work:
boost::python::class_<Glom::PyGlomRecord>("Record")
.def("__getitem__", &Glom::PyGlomRecord::getitem)
.def("__len__", &Glom::PyGlomRecord::len)
But when I try to use that in Python, I get this error:
"Boost.Python.class' object is unsubscriptable"
Is there something else that I need to do?
--
Murray Cumming
[email protected]
www.murrayc.com
www.openismus.com
_______________________________________________
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig