Pointers.py: Bringing the hell of pointers to Python (github.com) 2 points by ScottWRobinson 4y ago ↗ HN
[–] compressedgas 4y 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
1 comment
[ 3.1 ms ] story [ 14.9 ms ] threadWhere `to_ptr(x)` is:
And `ptr.dereference()` is: