Behavior of += (was Re: [Python-Dev] Customization docs)

Chris Barker Chris.Barker at noaa.gov
Wed Jun 5 15:49:25 EDT 2002


John Roth wrote:
> I don't see a compatability issue here, because
> the current behavior raises an exception.

Unless someone did the perverse thing I proposed in a earlier post, and
took advantage of the fact that the operation did, in fact, work, even
though it raised an exception!

While I completely agree with Huaiyu's argument (though I'm not sure the
"increment with re-binding" is really all that useful for mutables), and
I think the current semantics is a minor wart, I am convinced that the
original behavior that started this thread is a MAJOR WART (I'd call it
a bug). I think I have a pretty good understanding now of why it
happens, and why it isn't trivial to change, but I think it is a very
bad idea for an operation to raise an exception, but also be successful!

Chris


-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov



More information about the Python-list mailing list