Swig and raw pointers

Hi all, I have a question how swig handles interfaces that return a raw pointer. For instance, when creating a network in python

network = engine.Network()
network.addRegion("region1", "TestNode", "")
network.addRegion("region2", "TestNode", "")

region1 = network.getRegions().getByName("region1")

The piece “network.getRegions()” returns a Collection<Region*> in cpp. I assume that the pointers are convert to a nupic’s pyObject. Is that correct? If so, where is this logic implemented?

I’m inclined to switch to std::shared_pointer instead of raw pointers. At least this is supported by pybind11. Are there any good reasons not to do this?