"John Roth" <[EMAIL PROTECTED]> writes: > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > A much better idea would be to fix the underlying > situation that makes the global statement necessary.
You can't "fix" this. This code (in some python-like langauge that isn't python): x = 23 def fun(): x = 25 # Rest of code has two possible interpretations. Either the occurrence of x in fun references the global, or it references a local that shadows the global. There are reasons for wanting both behaviors. So you have to have some way to distinguish between the two, and you want it to happen per variable, not per function. The method with the fewest keywords is to have one be the default, and some keyword that triggers the other. So the only way to remove the global statement would be to have some way to mark the other interpretation, with say a "local" decleration. I thik that would be much worse than "global". For one thing, most variables would be local whether or not they are declared. Second, having an indication that you need to check module globals in the function is a better than not having that clue there. <mike -- Mike Meyer <[EMAIL PROTECTED]> http://www.mired.org/home/mwm/ Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information. -- http://mail.python.org/mailman/listinfo/python-list