I'm writing a spider. And in that spider I need to yield requests, with different params. It is something like,
for i in xrange(0, len(products), k):
some_ids = ','.join([a_product['id'] for a_product in products[i: i + k]])
for a_condition in ['c1', 'c2', 'c3']:
yield CustomRequest(url='api:endpoint',
params=dict(Condition=a_condition,
param1='val1',
param2=some_ids,
)
)
Is there more pythonic way to do this?