Fix fallout from f7869f8.
Also I do not understand why we add 1 to right (closing) indices.
j = keys.bisect_right(to_token) + 1
This makes us always include one entry past to_token, even if it exists:
to_token
>>> sd = SortedDict({ 1: 'a', 2: 'b', 3: 'c', 4: 'd', 6: 'f', 7: 'g', 8: 'h', 9: 'i', 11: 'k' }) >>> sd.items()[sd.bisect_right(1):sd.bisect_right(6)+1] [(2, 'b'), (3, 'c'), (4, 'd'), (6, 'f'), (7, 'g')] >>> sd.items()[sd.bisect_right(1):sd.bisect_right(5)+1] [(2, 'b'), (3, 'c'), (4, 'd'), (6, 'f')]
It is not obvious if such behavior is correct or not.
Can one of the admins verify this patch?
matrixbot: test this please
@hawkowl what is the story on the + 1 question?
+ 1
Login to write a write a comment.
Login via GitHub
Fix fallout from f7869f8.
Also I do not understand why we add 1 to right (closing) indices.
This makes us always include one entry past
to_token
, even if it exists:It is not obvious if such behavior is correct or not.