zlibmodule threadsafety changes: RFC

Richard Jones richard at bizarsoftware.com.au
Fri Aug 17 10:08:00 CEST 2001


On Friday 17 August 2001 17:57, Titus Brown wrote:
> PS Interesting, it looks like '+=' does some behind-the-scenes skullduggery
> when applied to strings... since 's = t = "a"; t += "b"; print s' doesn't
> do what I would have thought, given that += is supposed to "modify in
> place", I thought.

That behaviour is precisely why += etc didn't make it into the language for 
so long. No-one could agree on what the behaviour should be. Certainly, 
immutable strings should never be modified in place or python would fall 
about laughing.


    Richard




More information about the Python-list mailing list