[C++-sig] C++ derived from bp::dict

2011-02-10 Thread Michael Andronov
Hi,

Being a newbie to boost::python, I have a  question ( hopefully
simple), which failed to find the answer in mail logs:

let's say
a.  I have a  C++ class, derived from boost::python::dict ;
b.  I would like later to get access to myLong, and to the dictionary,
my class derived from.

Would mentioning the boost::python::dict as a base wtihin wrapping
section be enough to get access to dictionary?
(Something like...
"

class myd :boost::python::dict {
...
  public:
 unsigned long myLong;
}

BOOST_PYTHON_MODULE(mymod)
{
   using namespace boost::python;

   class_ > ("mydict")
 .def_readwrite("pd", &myd::pd);
   ...
}   

Thanks.

Michael.
___
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig


Re: [C++-sig] C++ derived from bp::dict

2011-02-10 Thread Michael Andronov
Thanks for a speedy reply!
Michael.
___
Cplusplus-sig mailing list
[email protected]
http://mail.python.org/mailman/listinfo/cplusplus-sig