-
Notifications
You must be signed in to change notification settings - Fork 311
seekable relative_seek() behaviour is confusing #862
Copy link
Copy link
Closed
Labels
pr-welcomeWe are open to PRs that fix this issue - leave a note if you're working on it!We are open to PRs that fix this issue - leave a note if you're working on it!
Description
Based on the example from the docs:
>>> it = seekable((str(n) for n in range(20)))
>>> it.seek(10)
>>> next(it)
'10'
>>> it.relative_seek(-2) # Seeking relative to the current position
>>> next(it)
'9'
At this point, I would expect the following:
>>> it.relative_seek(-2)
>>> next(it)
'8'
However, the actual return value is '9'.
The reason for that is that, as far as I understand, the method is not actually seeking relative to the current position, but to the end of internal buffer.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
pr-welcomeWe are open to PRs that fix this issue - leave a note if you're working on it!We are open to PRs that fix this issue - leave a note if you're working on it!