[Python-Dev] Issue5434: datetime.monthdelta (original) (raw)

skip at pobox.com skip at pobox.com
Thu Apr 16 10:45:24 CEST 2009


>>> date(2008, 1, 30) + monthdelta(1)
datetime.date(2008, 2, 29)

What would this loop would print?

for d in range(1, 32):
    print date(2008, 1, d) + monthdelta(1)

I have this funny feeling that arithmetic using monthdelta wouldn't always be intuitive.

Skip



More information about the Python-Dev mailing list