On 28 February 2014 14:43, Chris Angelico <ros...@gmail.com> wrote: > On Sat, Mar 1, 2014 at 1:41 AM, Joshua Landau <jos...@landau.ws> wrote: >> Would it be better to add a check here, such that if this gets raised >> to the top-level it includes a warning ("Addition was inplace; >> variable probably mutated despite assignment failure")? > > That'd require figuring out whether or not the variable was actually > mutated, and that's pretty hard to work out.
It does not. First, the "warning" is actually an attachment to the exception so is only shown if the exception is uncaught. This should basically never happen in working code. The warning exists only to remove likely misunderstanding in these odd cases. Even if "x = (1,); x[0] += 1" warned "addition was inplace; possible mutation occurred" or whatever phrasing you wish, this would only cause a quick check of the results. -- https://mail.python.org/mailman/listinfo/python-list