[Numpy-discussion] Casting Bug or a "Feature"?

Chris Barker - NOAA Federal chris.barker@noaa....
Thu Jan 17 10:21:26 CST 2013

On Wed, Jan 16, 2013 at 11:34 PM, Matthieu Brucher

> Of course a += b is not the same as a = a + b. The first one modifies the
> object a, the second one creates a new object and puts it inside a. The
> behavior IS consistent.

Exactly -- if you ask me, the bug is that Python allows "in_place"
operators for immutable objects -- they should be more than syntactic

Of course, the temptation for += on regular numbers was just too much to resist.



Christopher Barker, Ph.D.

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception


More information about the NumPy-Discussion mailing list