Y
Hacker News
new
|
ask
|
show
|
jobs
by
compressedgas
1558 days ago
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