Skip to content

python bindings don't allow shared_ptr<Grid>

A Grid can not be copied and as such has to be passed around either by reference or as a shared_ptr. The python bindings use the default holder type, which is unique_ptr. This makes it really difficult to pass a Grid constructed via the python bindings to existing code that stores the grid as a shared_ptr. I assume it would work with a reference, but the bindings should be flexible enough to work with different (reasonable) usage patterns.

We should switch the holder type of the Grid to shared_ptr. For other types like GridView I guess unique_ptr is OK, as we nowadays encourage people to copy a GridView, as it is supposed to be light weight.