[Python-Dev] dateutil (original) (raw)

Christian Tanzer tanzer at swing.co.at
Tue Mar 16 12:14:43 EST 2004


> I don't know. The problem here is that it is not obvious what is going > to happen. Consider: > > d1 = date(2004, 1, 31) > d2 = date(2004, 1, 28) > > d11 = d1 + relativedelta(months=1) > d21 = d2 + relativedelta(months=1)

It's obvious to me, and should be obvious to anyone who knows the behavior of this class. They'll land on Feb/29 and Feb/28, respectively. > If you subscribe to d11 == d21, what do you expect to be the result > of: Why would I 'subscribe' to that? > d11 + relativedelta(months=1) > d21 + relativedelta(months=1) > > Whatever you choose it will be seriously inconsistent from one point > of view or another. They'll land on Mar/29 and Mar/28? Where's the incosistency!?

Slapping my forehead: I used the wrong year. How about 2003?

-- Christian Tanzer http://www.c-tanzer.at/



More information about the Python-Dev mailing list