Re: heapq.merge with key=

2009-05-09 Thread Scott David Daniels
Peter Otten wrote: Kevin D. Smith wrote: On 2009-05-07 23:48:43 -0500, Chris Rebert said: On Thu, May 7, 2009 at 2:23 PM, Kevin D. Smith wrote: I need the behavior of heapq.merge to merge a bunch of results from a database I would prefer to do this with generators I need the key

Re: heapq.merge with key=

2009-05-09 Thread Peter Otten
Kevin D. Smith wrote: > On 2009-05-07 23:48:43 -0500, Chris Rebert said: > >> On Thu, May 7, 2009 at 2:23 PM, Kevin D. Smith >> wrote: >>> I need the behavior of heapq.merge to merge a bunch of results from a >>> database. I was doing this with sorted(itertools.chain(...), key= >> ...), but >

Re: heapq.merge with key=

2009-05-08 Thread Kevin D . Smith
On 2009-05-07 23:48:43 -0500, Chris Rebert said: On Thu, May 7, 2009 at 2:23 PM, Kevin D. Smith wrote: I need the behavior of heapq.merge to merge a bunch of results from a database.  I was doing this with sorted(itertools.chain(...), key= ...), but I would prefer to do this with generators

Re: heapq.merge with key=

2009-05-08 Thread bearophileHUGS
Looking for this, Kevin D. Smith? http://code.activestate.com/recipes/502295/ Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list

Re: heapq.merge with key=

2009-05-07 Thread Chris Rebert
On Thu, May 7, 2009 at 2:23 PM, Kevin D. Smith wrote: > I need the behavior of heapq.merge to merge a bunch of results from a > database.  I was doing this with sorted(itertools.chain(...), key=...), but > I would prefer to do this with generators.  My issue is that I need the key= > argument to s

heapq.merge with key=

2009-05-07 Thread Kevin D . Smith
I need the behavior of heapq.merge to merge a bunch of results from a database. I was doing this with sorted(itertools.chain(...), key=...), but I would prefer to do this with generators. My issue is that I need the key= argument to sort on the correct field in the database. heapq.merge does