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
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
>
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
Looking for this, Kevin D. Smith?
http://code.activestate.com/recipes/502295/
Bye,
bearophile
--
http://mail.python.org/mailman/listinfo/python-list
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
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