New submission from kaashif <musharraf.az...@gmail.com>: I tried Python's bisect module on a large word list (words.txt contained in http://www.greenteapress.com/thinkpython/swampy/swampy.1.1.zip)
If I search for something like 'musefully', 'museful' will come up as a match. Maybe that's a feature... but seems to me like a bug. Too much optimization going on here it seems, to such an extent that false positives are given. Here's the code I tried: import bisect fin = open('words.txt') t = [] for line in fin: t.append(line.strip()) print(bisect.bisect(t,'musefully')) ---------- components: Extension Modules files: words.txt messages: 91940 nosy: kaashif severity: normal status: open title: False positives given through bisect module (binary search) type: behavior versions: Python 3.1 Added file: http://bugs.python.org/file14780/words.txt _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6778> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com