Ronald Oussoren added the comment: issue-17973-experimental.txt is a very crude first attempt at catching augment assignment to an immutable LHS. On first glance the code works, but it causes problems in the test suite and hence isn't correct yet. The generated code also isn't optimal, the LHS is evaluated too many times.
With the patch ``([],)[0] += ['a']`` raises an exception, and doesn't update the list. I also haven't done benchmarking of the code, I'd expect a slowdown in micro benchmarks for augmented assignment when the LHS isn't a simple name because there is more byte code (``a[0] += b`` disassembly expands from 8 to 14 lines). ---------- Added file: http://bugs.python.org/file30318/issue-17973-experimental.txt _______________________________________ 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