Hi,

Actually, this behavior is already present in other languages, so I'm -1 on
additional verbosity.
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.

Cheers,

Matthieu


2013/1/17 Paul Anton Letnes <paul.anton.let...@gmail.com>

> 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
> to
> 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,
> Paul
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>



-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher
Music band: http://liliejay.com/
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to