<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Mon, Nov 19, 2018 at 1:41 AM Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'd rather keep the reference to memory addressing than start doing car<br>
analogies in the reference documentation.<br></blockquote><div><br></div><div>I agree -- and any of the car analogies will probably be only valid in some jurisdictions, anyway.</div><div><br></div><div>I think being a bit more explicit about what properties an ID has, and how the id() function works, and we may not need an anlogy at all, it's not that difficult a concept. And methions that in c_python the id is (currently) the memory address is a good idea for those that will wonder about it, and if there is enough explanation, folks that don't know about memory addresses will not get confused.</div><div><br></div><div>This is what's in the docs now (3.8.0a0):<br><br>"""</div><div>Every object has an identity, a type and a value. An object’s identity never changes once it has been created; you may think of it as the object’s address in memory. The ‘is’ operator compares the identity of two objects; the id() function returns an integer representing its identity.<br><br>**CPython implementation detail:** For CPython, id(x) is the memory address where x is stored.<br>"""<br><br>I suggest something like the following:</div><div><br></div><div><div>"""</div><div>Every object has an identity, a type and a value. An object’s identity uniquely identifies the object. It will remain the same as long as that object exists. No two different objects will have the same id at the same time, but the same id may be re-used for future objects once one has been deleted. The ‘is’ operator compares the identity of two objects; the id() function returns an integer representing its identity. ``id(object_a) == id(object_b)`` if and only if they are the same object. </div><div><br>**CPython implementation detail:** For CPython, id(x) is the memory address where x is stored.<br>"""</div></div><div><br></div><div>-CHB</div><div><br></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R (206) 526-6959 voice<br>7600 Sand Point Way NE (206) 526-6329 fax<br>Seattle, WA 98115 (206) 526-6317 main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div></div>