<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2017-09-01 13:05 GMT-07:00 Chris Barker <span dir="ltr"><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Thu, Aug 31, 2017 at 5:12 PM, Antoine Pitrou <span dir="ltr"><<a href="mailto:solipsis@pitrou.net" target="_blank">solipsis@pitrou.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I'm skeptical there are some programs out there that are limited by the<br>
speed of PyLong inplace additions. <br></blockquote><div><br></div></span><div>indeed, but that could be said about any number of operations.</div><div><br></div><div>My question is -- how can the interpreter know if it can alter what is supposed to be an immutable in-place? If it's used only internally to a function, the it would be safe, but how to know that?</div></div></div></div></blockquote><div>I believe Catalin's implementation checks if the object's refcount is 1. If that is the case, it is safe to mutate it. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>-CHB</div><span class="HOEnZb"><font color="#888888"><div><br></div><div><br></div></font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="m_-8050752554908390301gmail_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>
</font></span></div></div>
<br>______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/jelle.zijlstra%40gmail.com" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>jelle.zijlstra%40gmail.com</a><br>
<br></blockquote></div><br></div></div>