Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!news.glorb.com!solaris.cc.vt.edu!news.vt.edu!newsfeed-00.mathworks.com!panix!not-for-mail From: Grant Edwards Newsgroups: comp.lang.python Subject: Re: copy on write Date: Fri, 13 Jan 2012 15:13:33 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 26 Message-ID: References: <4f101f45$0$29999$c3e8da3$5496439d@news.astraweb.com> NNTP-Posting-Host: dsl.comtrol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: reader1.panix.com 1326467613 17977 64.122.56.22 (13 Jan 2012 15:13:33 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Fri, 13 Jan 2012 15:13:33 +0000 (UTC) User-Agent: slrn/pre0.9.9-102 (Linux) Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18921 On 2012-01-13, Devin Jeanpierre wrote: > On Fri, Jan 13, 2012 at 7:30 AM, Chris Angelico wrote: >> It seems there's a distinct difference between a+=b (in-place >> addition/concatenation) and a=a+b (always rebinding), which is sorely >> confusing to C programmers. But then, there's a lot about Python >> that's sorely confusing to C programmers. > > I think this is confusing to just about everyone, when they first > encounter it. That depends on what languages they've used in the past and whether they skip reading any documentation and just assume that all languages work the same way. I would agree that for the majority of new users, they previously used only languages where an assignment operator does a "copy value", and that 90+ percent of the time those new users they assume all languages work that way. I'm not sure what we can do about that -- Python's semantics are well documented. -- Grant Edwards grant.b.edwards Yow! If our behavior is at strict, we do not need fun! gmail.com