Chris Torek wrote:
Appending to the list is much faster, and if you are going to
dump a set of new items in, you can do that with:

    # wrong way:
    # for item in large_list:
    #    a.append(item)
    # right way, but fundamentally still the same cost (constant
    # factor is much smaller due to built-in append())
    a.append(large_list)
         ^- should be a.extend(large_list)

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to