Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
Pointers.py: Bringing the hell of pointers to Python | Better HN
Pointers.py: Bringing the hell of pointers to Python
(opens in new tab)
(github.com)
2 points
ScottWRobinson
4y ago
1 comments
Share
1 comments
default
newest
oldest
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
j
/
k
navigate · click thread line to collapse