[Numpy-discussion] simple python question on what happens when functions are declared

2008-11-19 Thread Frank Lagor
Thank you very much Robert. ___ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion

Re: [Numpy-discussion] simple python question on what happens when functions are declared

2008-11-19 Thread Robert Kern
On Wed, Nov 19, 2008 at 17:30, Frank Lagor <[EMAIL PROTECTED]> wrote: > Hi, > > Can someone please explain what happens here: > > In testfile.py: > > x = 5 > def arbFunc(): >print x You get an UnboundLocalError here. >del x During the compilation process, Python sees this statement and a

[Numpy-discussion] simple python question on what happens when functions are declared

2008-11-19 Thread Frank Lagor
Hi, Can someone please explain what happens here: In testfile.py: x = 5 def arbFunc(): print x del x print "Done with Test" arbFunc() Then run the file with python testfile.py As opposed to x = 5 print x del x print "Done with Test" Which of course works fine. This question is of