TE
TechEcho
Home
24h Top
Newest
Best
Ask
Show
Jobs
English
GitHub
Twitter
Home
Pointers.py: Bringing the hell of pointers to Python
2 points
by
ScottWRobinson
about 3 years ago
1 comment
compressedgas
about 3 years ago
Python already has this 'hell of pointers' in the ctypes module.<p>Where `to_ptr(x)` is:<p><pre><code> ptr = ctypes.pointer(ctypes.py_object(x)) </code></pre> And `ptr.dereference()` is:<p><pre><code> ptr.contents.value</code></pre>