Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
skitter
on Aug 9, 2023
|
parent
|
context
|
favorite
| on:
Swap_8_and_9: A simple import can modify the Pytho...
You don't even need C:
ctypes.c_int.from_address(id(8)+24).value = 9
jwilk
on Aug 9, 2023
[–]
That works only on 64-bit systems. You need something like this instead of 24:
ctypes.sizeof(ctypes.c_long) * 3
ketralnis
on Aug 9, 2023
|
parent
[–]
good thinking I definitely need this useful and widely used code to be legible and platform independent
Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: