rust-cpython
rust-cpython copied to clipboard
create PyBuffer from rust code
So I've had experience before creating python bindings with the C++ library pybind11 where I'm able to return python buffers but I can't figure out how to do the same with rust-cpython
@xd009642 sorry for the late reply, but you mean implementing Buffer Object Structures for Python Object defined with py_class!, right?
I don't see anything supporting that in rust-cpython. By contrast, cpython::PyBuffer provide methods for buffer consumption in the sense of the Buffer Protocol
I might be myself interested. If I understand correctly, implementing tp_as_buffer would be a good way to expose large array-like data structures to the Python interpreter.