[Numpy-discussion] Casting Bug or a "Feature"?
Thu Jan 17 01:34:27 CST 2013
Actually, this behavior is already present in other languages, so I'm -1 on
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.
2013/1/17 Paul Anton Letnes <firstname.lastname@example.org>
> On 17.01.2013 04:43, Patrick Marsh wrote:
> > Thanks, everyone for chiming in. Now that I know this behavior
> > exists, I can explicitly prevent it in my code. However, it would be
> > nice if a warning or something was generated to alert users about the
> > inconsistency between var += ... and var = var + ...
> > Patrick
> I agree wholeheartedly. I actually, for a long time, used to believe
> that python would translate
> a += b
> a = a + b
> and was bitten several times by this bug. A warning (which can be
> silenced if you desperately want to) would be really nice, imho.
> Keep up the good work,
> NumPy-Discussion mailing list
Information System Engineer, Ph.D.
Music band: http://liliejay.com/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion