osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?


Chris Angelico wrote:
> I would be strongly in favour of ctypes gaining a "get address of
> object" function, which happens (in current CPythons) to return the
> same value as id() does, but is specifically tied to ctypes.

Isn't this what the ctypes.py_object type is for?

Also, any code that does anything with the address of an object
other than just pass it around is going to depend heavily on
the Python implementation being used, so the idea of an
implementation-independent way to deal with object addresses
seems problematic.

-- 
Greg