The offset parameter is documented as supporting negative values (read.py:24): "Negative values count backwards from the end (e.g. -1 is the last line)." But the implementation silently resets any negative offset to 1 (read.py:53-54):
if offset is None or offset < 0:
offset = 1
So the documented count-from-end behaviour is unimplemented — offset=-1 reads from the start, not the last line.
Suggested fix: implement the from-end semantics, or remove the claim from the parameter description.
The
offsetparameter is documented as supporting negative values (read.py:24): "Negative values count backwards from the end (e.g. -1 is the last line)." But the implementation silently resets any negative offset to 1 (read.py:53-54):So the documented count-from-end behaviour is unimplemented —
offset=-1reads from the start, not the last line.Suggested fix: implement the from-end semantics, or remove the claim from the parameter description.