> def handle(line, lineno, file):
> if string.find(string.lower(line), '__') >= 0:
> print "Dubious code found at line", lineno,
> print "of file", file
> print "Contents:", string.strip(line)
I missed it at first, so it was twice as funny when it hit.
As an example of non-dubious code, I think he should have replaced the
obscure
string.find(...)
with
import string
getattr(string,filter(lambda x:x[0]=='f',dir(string))[0])(...)
just-kidding-just-kidding-just-kidding-ly y'rs - tim
Tim Peters tim@ksr.com
not speaking for Kendall Square Research Corp