
21 Dec
2010
21 Dec
'10
7:47 a.m.
Hi, is it possible to have python have readonly access to class members that are non constant? typedef map<string,string> Links; class DataSet { Links links; } BOOST_PYTHON_MODULE(_boosttest) { class_<Links>("Links") .def(map_indexing_suite<Links>()); class_<DataSet>("DataSet") .def_readonly("links",&DataSet::links); } Although DataSet.links is defined readonly I can change it from within python. What can I do to prevent python from overwriting links? Thanks, Ralf