<html>
<body>
At 12:44 AM 6/28/2008, Dick Moores wrote:<br>
<blockquote type=cite class=cite cite="">At 12:11 AM 6/28/2008, Douglas
Drumond wrote:<br>
<blockquote type=cite class=cite cite="">
<blockquote type=cite class=cite cite="">
<dl>
<dd>But if you don't have l1 defined yet, you can't add to l2<br>
<dd>It's like:<br>
<dd><tt>def a2():</tt><br>
<dd><tt> l1 = foo +
l2</tt><br><br>
<dd><tt>UnboundLocalError: local variable 'foo' referenced before
assignment</tt><br><br>
<dd>It's because l1 (and foo at above example) is a local variable.<br>
<dd>a1's l1 is different from a2's l1.</blockquote><br>
<dd>Sorry to be dense, but how, in what way, is a1's l1 different
from a2's l1"? Both are <tt>[1,2,3]*100 .<br><br>
</tt>
</dl><br>
Both contain same value, but are in different namespaces (so, different
context and different memory areas).<br><br>
If you do a="spam" and b="spam", this doesn't make
them same variable, they just have same value.<br><br>
So is in that code. But to make it more confusing, names were the
same.</blockquote></blockquote><br>
No I didn't mean that they were the same variable, but that they had the
same value, and both appear in the same form just below the
if __name__ == '__main__': below their respective
functions.<br><br>
Dick<br><br>
</body>
</html>