<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, May 5, 2013 at 12:59 PM, Armin Rigo <span dir="ltr"><<a href="mailto:arigo@tunes.org" target="_blank">arigo@tunes.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Can we fix it once and for all?  It's annoying because of id: if we<br>
want ``x is y`` for equal huge strings x and y, but still want<br>
``id(x)==id(y)``, then we have to compute ``id(some_string)`` in a<br>
rather slow way, producing a huge number.  The same for tuples: if we<br>
always want ``(1, 2) is (1, 2)`` then we need to compute<br>
``id(some_tuple)`` recursively, which can also lead to huge numbers.<br>
In fact such a definition can explode the memory: ``a = (); for i in<br>
range(100): a = (a, a); id(a)`` would likely need a 2**100-digits<br>
number.</blockquote></div><br></div><div class="gmail_extra">If the "id(x)==id(y)" requirement is removed, does it mean that "x is y" for immutable types is simply "x==y"?<br></div><div class="gmail_extra">
So if we have ``a = (); for i in
range(100): a = (a, a); b = (a, a)`` then "a is b" will be computationally expensive?<br></div><div class="gmail_extra"><br></div></div>