2009/8/17 Simon Forman sajmik...@gmail.com
You can use a little helper function to create your itemgetter like this:
def makeItemGetter(indexes):
I = itemgetter(*indexes)
if len(indexes) 1:
return I
return lambda thing: (I(thing),)
If indexes contains only one index the
On Thu, Aug 13, 2009 at 11:16 PM, dou dounirvana...@gmail.com wrote:
I have a function to do some thing like LEFT JOIN in SQL, the function use
the itemgetter to get the ON and SELECT parameters of the two table(list
of list), the problem is that itemgetter may return a value or a tuple of
I have a function to do some thing like LEFT JOIN in SQL, the function use
the itemgetter to get the ON and SELECT parameters of the two table(list
of list), the problem is that itemgetter may return a value or a tuple of
values, because of the inconsistent return type of itemgetter, I have to do