Tuples and immutability

Rick Johnson rantingrickjohnson at gmail.com
Tue Mar 11 22:01:43 EDT 2014


On Thursday, February 27, 2014 4:18:01 PM UTC-6, Ian wrote:
> x += y is meant to be equivalent, except possibly in-place and more
> efficient, than x = x + y.  

In an ideal world, the speed of these two codes should be the same, of course i'm "assuming" that most competent language designers would optimise the slower version. 

"""But Rick, Python is an interpreted language and does not benefit from a compile stage."""

Even if the bytecode can't be optimized on the current run, it CAN be optimized by updating the .pyo file for future runs without degrading current (or future) runtime performance.



More information about the Python-list mailing list