[Python-3000] StringIO/BytesIO in io.py doesn't over-seek properly

Alexandre Vassalotti alexandre at peadrop.com
Mon Jul 2 20:59:28 CEST 2007


On 7/2/07, Guido van Rossum <guido at python.org> wrote:
> Honestly, I think truncate() should always set the current position to
> the new size, even though that's not what it currently does. Or at
> least it should set it to the new size if that's less than the current
> position. What's the rationale (apart from "Unix defined it so") why
> it currently leaves the position unchanged?

No idea. I just know that truncate in the old StringIO module do set
the position to the new size if the new size is less than the current
position. And that is how I implemented it in _bytes_io and
_string_io.


More information about the Python-3000 mailing list