On Fri, Jun 27, 2008 at 2:45 AM, Mark Tolonen <[EMAIL PROTECTED]> wrote:
> The above solutions create new lists. If a functional requirement is to > modify the list in place, then the original is fine (on Python 2.6 and > later) or should use xrange instead of range (on Python 2.5 or earlier, > especially for large lists). range() has not changed it Python 2.6, it still returns a list. 2.6 makes only backwards-compatible changes. The Python 2.6 docs say, "The advantage of xrange() over range() is minimal (since xrange() still has to create the values when asked for them) except when a very large range is used on a memory-starved machine or when all of the range's elements are never used (such as when the loop is usually terminated with break)." Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor