This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nickzoic
Recipients Sriram Rajagopalan, belopolsky, gerardw@alum.mit.edu, gregory.p.smith, nickzoic, p-ganssle, polymorphm, xtreak
Date 2020-03-03.17:16:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1583255780.45.0.128727702938.issue26460@roundup.psfhosted.org>
In-reply-to
Content
It's kind of funny that there's already consideration of this in _strptime._strptime(), which returns a tuple used by datetime.datetime.strptime() to construct the new datetime.
Search for `leap_year_fix`.

I think the concern though is if we changed the default year that might possibly break someone's existing code: thus my suggestion to allow the programmer to explicitly change the default.

However, I can also see that if their code is parsing dates in this way it is already wrong, and that if we're causing users pain now when they upgrade Python we're at least saving them pain at 2024-02-29 00:00:01.

Taking that approach, perhaps parsing dates with no year should just throw an exception, forcing the programmer to do it right the first time.  In this case though, I'd rather have a "year" kwarg to prevent the programmer having to do horrible string hacks like my code currently does.

I'm not sure: is it useful for me to produce a PR so we have something specific to consider?
History
Date User Action Args
2020-03-03 17:16:20nickzoicsetrecipients: + nickzoic, gregory.p.smith, belopolsky, polymorphm, Sriram Rajagopalan, p-ganssle, xtreak, gerardw@alum.mit.edu
2020-03-03 17:16:20nickzoicsetmessageid: <1583255780.45.0.128727702938.issue26460@roundup.psfhosted.org>
2020-03-03 17:16:20nickzoiclinkissue26460 messages
2020-03-03 17:16:20nickzoiccreate