StringIO proposal: add __iadd__

Alex Martelli aleax at
Mon Jan 30 00:06:20 EST 2006

Paul Rubin <> wrote:

> And is making += a synonym for write() on other file objects really
> that bad an idea?  It would be like C++'s use of << for file objects
> and could make some code nicer if you like that kind of thing.

Not really: <<'s point is to allow chaining, f<<a<<b<<c.  += would have
no such "advantage" (or disadvantage, as the case may be).


More information about the Python-list mailing list