TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Pointers.py: Bringing the hell of pointers to Python

2 pointsby ScottWRobinsonabout 3 years ago

1 comment

compressedgasabout 3 years ago
Python already has this &#x27;hell of pointers&#x27; 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>