StringIO proposal: add __iadd__

Raymond Hettinger python at rcn.com
Sun Jan 29 22:27:30 EST 2006


[Paul Rubin]
> here, "temp_buf += v" is supposed to be the same as "temp_buf.write(v)".
> So the suggestion is to add a __iadd__ method to StringIO and cStringIO.
>
> Any thoughts?

The StringIO API needs to closely mirror the file object API.
Do you want to change everything that is filelike to have +=
as a synonym for write()?

In for a penny; in for a pound.


Raymond




More information about the Python-list mailing list