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

Paul Moore p.f.moore at gmail.com
Tue Jul 3 17:13:51 CEST 2007


On 03/07/07, Alexandre Vassalotti <alexandre at peadrop.com> wrote:
> I also find the semantic make more sense too. For example:
>
>   >>> s = StringIO("Good bye, world")
>   >>> s.truncate(10)
>   >>> s.write("cruel world")
>   >>> s.getvalue()
>   ???
>
> I think that should return "Good bye, cruel world", not "cruel world".
>
> So, does anyone else agree with this small semantic change of truncate()?

Looks reasonable to me - without checking documentation, your proposal
is what I'd expect the example to do.

Paul.


More information about the Python-3000 mailing list