mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
Move comment to correct line.
This commit is contained in:
parent
e046d2aefd
commit
27352a5993
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user