Reference

Marko Rauhamaa marko at pacujo.net
Wed Mar 5 16:14:44 EST 2014


Ben Finney <ben+python at benfinney.id.au>:

> A reference-compliant implementation can contradict your inference (by
> returning an object identity that is *not* the object's memory
> address). Any code you've written based on that false inference will
> break.
>
> The fault will be yours, for inferring an assertion that isn't implied
> by the definition.

Show me a few lines of Python that demonstrate the error of the false
inference, please.

When I talk about an object's memory address, I'm not referring to what
might be revealed by gdb, for example. That is, I'm not talking about
the process's virtual address space, nor am I talking about the physical
address on the address bus. I can simply define that the object's memory
address is whatever id() returns.


Marko



More information about the Python-list mailing list