A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-April/088833.html below:

[Python-Dev] Issue5434: datetime.monthdelta

[Python-Dev] Issue5434: datetime.monthdelta [Python-Dev] Issue5434: datetime.monthdeltaSteven D'Aprano steve at pearwood.info
Fri Apr 17 04:42:45 CEST 2009
On Fri, 17 Apr 2009 07:47:14 am Antoine Pitrou wrote:
> Jess Austin <jess.austin <at> gmail.com> writes:
> > What other behavior options besides "last-valid-day-of-the-month"
> > would you like to see?
>
> IMHO, the question is rather what the use case is for the behaviour
> you are proposing. In which kind of situation is it acceptable to
> turn 31/2 silently into 29/2?

Any time the user expects "one month from the last day of January" to 
mean "the last day of February". I dare say that if you did a poll of 
non-programmers, that would be a very common expectation, possibly the 
most common.

I just asked the missus, who is a non-programmer, what date is one month 
after 31st January and her answer was "2rd of March on leap years, 
otherwise 3rd of March".


-- 
Steven D'Aprano
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4