gundlach wrote:
I *know* this already exists, but I can't remember where:
def pivot(func, seq):
# I know, a good implementation shouldn't call func() twice per item
return ( (x for x in seq if func(x)), (x for x in seq if not
func(x)) )
I feel like I read a thread in which this was argued t
On 3/11/2010 6:16 PM, gundlach wrote:
I *know* this already exists, but I can't remember where:
def pivot(func, seq):
# I know, a good implementation shouldn't call func() twice per item
return ( (x for x in seq if func(x)), (x for x in seq if not
func(x)) )
I feel like I read a thread in
I *know* this already exists, but I can't remember where:
def pivot(func, seq):
# I know, a good implementation shouldn't call func() twice per item
return ( (x for x in seq if func(x)), (x for x in seq if not
func(x)) )
I feel like I read a thread in which this was argued to death, and I
can