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 ammar2
Recipients ammar2, p-ganssle, serhiy.storchaka
Date 2020-12-16.16:48:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1608137302.1.0.510275666551.issue42660@roundup.psfhosted.org>
In-reply-to
Content
> Some compilers complain about checking `day < 0`, because `day` is an unsigned type

Just my two cents, this isn't just "some compilers". Everything from gcc, msvc, C# to the rust compiler complain about this sort of code. As they should, this is effectively dead code.

I think the more pragmatic way to enforce and document this assumption would be to have a unit test that actually checks that the constructor fails with "negative" days. It'll continue to fail right now as its interpretation as an unsigned int will be large and it will start failing if someone changes this to a signed type.
History
Date User Action Args
2020-12-16 16:48:22ammar2setrecipients: + ammar2, serhiy.storchaka, p-ganssle
2020-12-16 16:48:22ammar2setmessageid: <1608137302.1.0.510275666551.issue42660@roundup.psfhosted.org>
2020-12-16 16:48:22ammar2linkissue42660 messages
2020-12-16 16:48:22ammar2create