
2008/5/22 Isaac Morland <ijmorlan@cs.uwaterloo.ca>:
By contrast, the worst that can happen with no sharing is that performance and memory use is what you expect - the only "bad" is the apparent missed opportunity for optimization.
Exactly, "apparent". Also, this could be handled like a "good writing tip". For example, right now everybody knows that appending a letter to a string a zillion times is not efficient, you should store them in a list, and then .join() them. Similarly, we could know that slicing zillions of long lines and keeping small portion of them is not memory efficient, you should do everytime "shortstring = str(longstring[:2])", for example. Note that this "special coding" will be for an "special case"... in your normal life the code just will be more efficient... Regards, -- . Facundo Blog: http://www.taniquetil.com.ar/plog/ PyAr: http://www.python.org/ar/