<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On 2011-05-30, at 20:52 , Benjamin Kaplan wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Mon, May 30, 2011 at 5:28 PM, Henry Olders <<a href="mailto:henry.olders@mcgill.ca">henry.olders@mcgill.ca</a>> wrote:<br><blockquote type="cite"><br></blockquote><blockquote type="cite">On 2011-05-29, at 4:30 , Henry Olders wrote:<br></blockquote><blockquote type="cite"><br></blockquote><font class="Apple-style-span" color="#540000"><br></font>Python doesn't have true globals. When we say "global" what we mean is<br>"module or built-in". Also, consider this code<br><br>from math import sin<br>def redundant_sin(x) :<br> return sin(x)<br><br>In Python, everything is an object. That includes functions. By your<br>definition, that function would either have to be written as<br>def redundant_sin(sin, x) :<br>and you would have to pass the function in every time you wanted to<br>call it or have a "global sin" declaration in your function. And you<br>would need to do that for every single function that you call in your<br>function body.<br><br></div></blockquote></div>I don't believe so. Within redundant_sin, x is local, so if I change x, it will not change any objects named x outside of the function. As far as sin is concerned, if it were passed to redundant_sin via the parameter list, then it would be local, but otherwise sin would be looked for in the function definition; if not found there, it would be looked for in the module, where it would be found. I am not suggesting any changes to how names are looked up or scoped.<div><br></div><div>Henry</div></body></html>