How to sort very large arrays?

Terry Reedy tjreedy at
Sat Jun 14 00:29:42 CEST 2008

"kj" <socyl at> wrote in message 
news:g2uc8o$pjk$1 at
| I'm downloading some very large tables from a remote site.  I want
| to sort these tables in a particular way before saving them to
| disk.  In the past I found that the most efficient way to do this
| was to piggy-back on Unix's highly optimized sort command.  So,

If the tables can fit in memory as a list of key,text tuples and if they 
have some of the non-random structure exploited by Python's current 
list.sort (only documented, as far as I know, either in the source or test 
code, not sure), then you might consider that.  Otherwise, use the system 

More information about the Python-list mailing list