Ronald Oussoren added the comment:

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.

----------
keywords: +patch
Added file: http://bugs.python.org/file30294/faq-update.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17973>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to