On 2013-03-16 15:39, Rick Johnson wrote: > On Saturday, March 16, 2013 4:19:34 PM UTC-5, Oscar Benjamin wrote: > > # tmp.py > > def broken(x): > > if x > 2: > > print(x) > > else: > > print(undefined_name) > > > > broken(1) > > Why would anyone write code like that?
Because, in the real world, that example looks something like def broken(intelligence_level): if intelligence_level < 100: return dumb_down(intellegence_level) else: return make_harder(intelligence_level) broken(op.iq) Pylint, pyflakes or some other such linter should catch it, but this happens ALL THE TIME in actual development, occasionally leaking into production. -tkc -- http://mail.python.org/mailman/listinfo/python-list