r a écrit : > On Nov 11, 2:37 am, Steven D'Aprano > <ste...@remove.this.cybersource.com.au> wrote: >> On Wed, 11 Nov 2009 00:08:58 -0800, r wrote: > >>> Yea it's called a NameError. Would it not also blow up in the current >>> state of syntax usage? >> No. >> >>> if var: >>> print 'var' >>> Traceback (most recent call last): >>> File "<pyshell#45>", line 1, in <module> >>> if var: >>> NameError: name 'var' is not defined >> You missed a line: >> >> var = range(N) >> if var: > > Oh i get it now! If i assign a valid value to a variable the variable > is also valid...thats...thats... GENUIS! *sarcasm*
It's not about "assigning a valid value to a variable", it's about the name being created (or not) in the current namespace, whatever it's bound to. -- http://mail.python.org/mailman/listinfo/python-list