index = itertools.count()

def score(entry):
    return scoring(num_items, next(index))
return sorted(items_list, key=score)
In Python, partial function application (currying) versus explicit function definition