This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ronaldoussoren
Recipients andy.chugunov, flox, r.david.murray, ronaldoussoren
Date 2013-05-17.15:07:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1368803234.1.0.19175144957.issue17973@psf.upfronthosting.co.za>
In-reply-to
Content
You've got a point there. What about this patch (but then with proper english grammer)?

BTW. Actually fixing this wart would be possible, but at a significant cost: you'd have to change the implementation of LHS += RHS from:

   tmp = LHS
   tmp = tmp.__iadd__(RHS)
   LHS = tmp

to:

   tmp = LHS
   LHS = tmp
   tmp = tmp.__iadd__(RHS)
   LHS = tmp

The odd assignment on the second line would detect that the LHS is immutable in 99+% of use cases before updating the RHS.

My gut feeling is that an implementation of this would have too high a cost (both in runtime performance and in a more complicated compiler), although it would be interesting to actually see a patch.
History
Date User Action Args
2013-05-17 15:07:14ronaldoussorensetrecipients: + ronaldoussoren, r.david.murray, flox, andy.chugunov
2013-05-17 15:07:14ronaldoussorensetmessageid: <1368803234.1.0.19175144957.issue17973@psf.upfronthosting.co.za>
2013-05-17 15:07:14ronaldoussorenlinkissue17973 messages
2013-05-17 15:07:13ronaldoussorencreate