It is not clear to me in what way line 3 is different than line 2 - both are assignments... Please clarify<br><br>Elisha<br><br><div class="gmail_quote">On Thu, Jun 18, 2009 at 10:37 AM, Jojo Mwebaze <span dir="ltr">&lt;<a href="mailto:jojo.mwebaze@gmail.com">jojo.mwebaze@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Tutor<br><br>The problem i have is to see which statements modify my data at execution time without referring to the code. Referring to the code is difficult esp because of branching. You can never tell before hand which branch execution will follow.<br>


<br>e.g in the example below, statements 1, 2, 5,7 and 10 modify my data and are the ones i would like to trace during run time. However the other statements do not change my data so am not interested in them. <br><br>How can this be achieved during execution? Not sure if the traceback module can be helpful here!<br>


<br>Cheers<br><br>Jojo.<br><br>===========================<br><br>def myfunction():<br>1.    num1= 20 #statement 1<br>2.    num2 = 30 #statement 2<br>3.    somelist= [ ]  #statement 3<br>4.    if (num1 &lt; num2): <br>5.          num2 = num2 * 20 #statement 3<br>

6.    else:<br>7         num2 = num1 + num2 #statement 3<br>8.    mylist = [num1, num2] #statement 4<br>9.    for items in mylist:<br>10.       somelist.append( math.sqrt(item) + math.log(item)) #statement 5<br>11.   return somelist<br>


<br>
<br>_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/tutor" target="_blank">http://mail.python.org/mailman/listinfo/tutor</a><br>
<br></blockquote></div><br>