One approach is to expose both classes:
class_<Thing>("thing")
.def_readwrite("i", &Thing::i)
;
class_<Container>("container")
.def_readwrite("n_things", &Container::n_things)
;
and then create a method that returns a reference to the Thing:
Thing& get_thing(Container& c, size_t index)
{
return *c.things[index];
}
finally, you should expose this function:
def("get_thing", get_thing, return_value_policy<reference_existing_object>());
and than you can iterate over it:
c = mylib.container()
for i in xrange(c.n_things):
thing = get_thing(c, i)
thing.i = <INT_VALUE>