$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] Boost::python readonly access to nonconstant class members
From: Ralf Goertz (R_Goertz_at_[hidden])
Date: 2010-12-21 09:47:38
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