efficient idiomatic queue?

James_Althoff at i2.com James_Althoff at i2.com
Tue Jan 15 17:34:48 EST 2002


Speaking of generator abuse ...

Anything like this:

def mergesort(alist):
    if len(alist) <= 1:
        return iter(alist)
    return merge(mergesort(alist[:len(alist)//2]),
        mergesort(alist[len(alist)//2:]))

is probably going to create way too many generator/iterator instances to
scale well.

Jim





More information about the Python-list mailing list