<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span><br></span></div><div><br></div> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">De:</span></b> Emiliano Gavilan <emilianogavilan@gmail.com><br> <b><span style="font-weight: bold;">Para:</span></b> programacion@lugro.org.ar <br> <b><span style="font-weight: bold;">Enviado:</span></b> jueves, 20 de septiembre de 2012 8:28<br> <b><span style="font-weight: bold;">Asunto:</span></b> Re: [Programación]Paso por valor o referencia? En las funciones en Python<br> </font> </div> <br>El día 20 de septiembre de 2012 07:50, Horacio Castellini<br><<a ymailto="mailto:horacio9573@yahoo.com.ar"
href="mailto:horacio9573@yahoo.com.ar">horacio9573@yahoo.com.ar</a>> escribió:<br><br>> Si un objeto int fuera inmutable como una tupla o un string,, donde el "="<br>> crea otro objeto inmutable, y a cada copia debería estar asignada a areas de<br>> memoria distinta, esto debería causar un memory overflow, por ejemplo en un<br>> código como este...<br>><br>> x=0<br>> while True:<br>> x=x+3<br><br>No hay memory overflow porque, aunque el interprete crea un nuevo objeto<br>en cada iteración, el anterior es borrado ya que queda huérfano,<br>sin ninguna referencia.<br>Acá no estoy muy seguro, pero probablemente python use algun tipo de<br>reference counting en los objetos. Esto permite que se liberen rapidamente<br>y no como en java, en el cual el garbage collection suele aparecer en los<br>momentos menos oportunos haciendo que el proceso palme...</div><div style="color: rgb(0, 0, 0); font-size: 14px;
font-family: Arial; background-color: transparent; font-style: normal; font-weight: bold; " class="yui_3_2_0_17_134818310721867"><br></div><div style="font-weight: bold; color: rgb(0, 0, 0); font-size: 15px; font-family: Arial; background-color: transparent; font-style: normal; " class="yui_3_2_0_17_134818310721867">----------------------------------</div><div style="font-weight: bold; color: rgb(0, 0, 0); font-size: 15px; font-family: Arial; background-color: transparent; font-style: normal; " class="yui_3_2_0_17_134818310721867"><br></div><div style="font-weight: bold; color: rgb(0, 0, 0); font-size: 15px; font-family: Arial; background-color: transparent; font-style: normal; " class="yui_3_2_0_17_134818310721867">vaya... cada día se aprende algo nuevo... gracias... nunca imaginé que fuera así...</div><div style="font-weight: bold; color: rgb(0, 0, 0); font-size: 15px; font-family: Arial; background-color: transparent; font-style: normal; "
class="yui_3_2_0_17_134818310721867"><br></div><div style="font-weight: bold; color: rgb(0, 0, 0); font-size: 15px; font-family: Arial; background-color: transparent; font-style: normal; " class="yui_3_2_0_17_134818310721867"><br><br> </div> </div> </div></body></html>