Closed benbovy closed 1 year ago
Not sure if it is really safe to use a static class member to store the Geography python type pointer as a cache
Maybe a cleaner solution would be to store the type in a capsule, e.g., via some init function called just after importing the compiled Python extension (would require installing it as a subpackage).
Partially improves #3
It is not very nice to rely on pybind11 internals but I'm afraid that there's currently no way around that. It's probably worth it given the large gain in performance over directly using
pybind11::cast()
(almost 10x).Not sure if it is really safe to use a static class member to store the Geography python type pointer as a cache, but it seems to work. I'll wait adding CI configuration (run tests) in another PR before merging this.