[Python-Dev] dateutil (original) (raw)
Gustavo Niemeyer niemeyer at conectiva.com
Tue Mar 16 09:26:42 EST 2004
- Previous message: [Python-Dev] dateutil
- Next message: [Python-Dev] dateutil
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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!?
-- Gustavo Niemeyer http://niemeyer.net
- Previous message: [Python-Dev] dateutil
- Next message: [Python-Dev] dateutil
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]