
April 2, 2020
6:05 p.m.
Christopher Barker writes:
On Thu, Apr 2, 2020 at 6:07 AM Stephen J. Turnbull < turnbull.stephen.fw@u.tsukuba.ac.jp> wrote:
Yah, but you also get
outfile.seek(some_random_place) outfile += something
Is that not exactly the same as what you can do with .write() now?
Yes. But it flies in the face of the normal semantics of str '+=' (concatenate, not overwrite) while it's exactly how seekable writable streams have worked since the '70s. I just don't ever want to see that, but I know I will. YMMV, I think it's too high a price to pay for syntactic sugar. I wouldn't have the same objection to a standalone StringBuilder class (I have other objections to that, see Paul Moore's post on multiple TOOWTDI).