Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Pointers.py: Bringing the hell of pointers to Python (github.com/zerointensity)
2 points by ScottWRobinson on March 10, 2022 | hide | past | favorite | 1 comment


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: