Python 芹菜弦上的生成器表达式错误?

Python 芹菜弦上的生成器表达式错误?,python,celery,Python,Celery,我写过这样一首芹菜和弦: current = raw_input("Please give the date in this format 'dd/mm/yyyy': ") day,month,year = current.split('/') date = datetime.date(int(year), int(month), int(day)) date1 = datetime.date(2014, 06, 17) date = date.toordinal() date1 = date1

我写过这样一首芹菜和弦:

current = raw_input("Please give the date in this format 'dd/mm/yyyy': ")
day,month,year = current.split('/')
date = datetime.date(int(year), int(month), int(day))
date1 = datetime.date(2014, 06, 17)
date = date.toordinal()
date1 = date1.toordinal()

callback = A.si((datetime.date.fromordinal(i)) for i in range(date,date1+1))
header = [B.si((datetime.date.fromordinal(i)) for i in range(date,date1+1))]
result = chord(header)(callback)
res = result.apply_async()
res.get()
现在我有一个错误:

TypeError: object.__new__(generator) is not safe, use generator.__new__()

我如何编写
回调
?????

我怀疑这是因为芹菜正在进行任务参数的序列化(默认情况下使用pickle)/副本,并且由于生成器或,它会产生此错误。您应该尝试使用列表(或元组):


我使用了您显示的list元素,但它现在出现了此错误“TypeError:descriptor“strftime”需要一个“datetime.date”对象,但收到了一个“list”,这可能是任务中代码中的错误,这可能与芹菜无关。从错误的外观来看,您试图将strftime直接应用于列表
日期
,而不是将其应用于其每个值。
dates = [datetime.date.fromordinal(i) for i in range(date, date1 + 1)]
callback = A.si(dates)
header = [B.si(dates)]
result = chord(header)(callback)
res = result.apply_async()
res.get()