1 comment

[ 3.1 ms ] story [ 14.9 ms ] thread
Python already has this 'hell of pointers' in the ctypes module.

Where `to_ptr(x)` is:

  ptr = ctypes.pointer(ctypes.py_object(x))
And `ptr.dereference()` is:

  ptr.contents.value