[Python-Dev] ctypes: is it intentional that id() is the only way to get the address of an object?
Tim Peters wrote:
> The dict itself keeps the objects alive.
Yes, but the idea of a cache is that you're free to flush
things out of it to make room for something else without
It sounds like MRAB is using ids as weak references,
without the assurance actual weak references give you
that they become invalidated when the refefenced object
> No such uses care about object addresses, though - just that id(obj)
> returns a value usable as a dict key, unique among all reachable
> objects at the time `id()` is called.
Yep. In hindsight it was probably a mistake for the docs
to talk about addresses in relation to id() -- it seems to
have given some people unrealistic expectations.