最佳答案
如何对日期和/或日期时间对象的列表进行排序:
from datetime import datetime,date,timedelta
a=[date.today(), date.today() + timedelta(days=1), date.today() - timedelta(days=1)]
print a # prints '[datetime.date(2013, 1, 22), datetime.date(2013, 1, 23), datetime.date(2013, 1, 21)]'
a = a.sort()
print a # prints 'None'....what???