> To back myself up: > > <file name="why_no.py"> > #!/usr/bin/python > > import random > > for i in range(1,10000): > if random.random() < 0.001: > print "rare" > if malformed < beast: > print "kick me in the ..." > else: > print "whatever" > </file> This kind of error is not a syntax error; this kind of error is indeed only discovered at runtime. However, syntax errors are discovered at byte-compile time. byte-compile happens automatically when you load a module, but you can perform it yourself easily, and this is recommended in certain situations.
For this kind of error (try to reference an undefined variable), there are tools like pychecker. -- Software is like sex: it is better when it is free - Linus Torvalds