Move comment to correct line.

This commit is contained in:
Raymond Hettinger 2009-06-11 22:06:06 +00:00
parent e046d2aefd
commit 27352a5993

View File

@ -77,8 +77,8 @@ Instead, it is better to search a list of precomputed keys to find the index
of the record in question::
>>> data = [('red', 5), ('blue', 1), ('yellow', 8), ('black', 0)]
>>> data.sort(key=lambda r: r[1]) # precomputed list of keys
>>> keys = [r[1] for r in data]
>>> data.sort(key=lambda r: r[1])
>>> keys = [r[1] for r in data] # precomputed list of keys
>>> data[bisect_left(keys, 0)]
('black', 0)
>>> data[bisect_left(keys, 1)]