I have a python set
that contains a collection of non-hashable python objects with uniform type which I want to process.
To improve efficiency of my algorithms, I would like to interface using ctypes with an external index implementation that accepts only uint64
as data values.
I was hoping that I could to pass pointer references to the python object into this external library as uint64
?
I tried ctypes.cast(ctypes.py_object(my_python_object), ctypes.c_uint64)
but am getting ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
.
Also, what about the reverse, getting a reference to a python object as uint64
and turning it into a "real" python object?