StringIO proposal: add __iadd__

Alex Martelli aleax at mail.comcast.net
Mon Jan 30 00:06:20 EST 2006


Paul Rubin <http://phr.cx@NOSPAM.invalid> 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).


Alex



More information about the Python-list mailing list