Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
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
compressedgas
on March 10, 2022
[–]
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:
Where `to_ptr(x)` is:
And `ptr.dereference()` is: