homepage

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 p-ganssle
Recipients SilentGhost, Steven Davidson, anglister, belopolsky, lemburg, p-ganssle, serhiy.storchaka, skrah, vstinner
Date 2019年02月27日.17:10:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551287429.2.0.116112410519.issue23607@roundup.psfhosted.org>
In-reply-to
Content
Oh actually that's my mistake. I can't reproduce the failure in the constructor in the Python version of the module, and also it seems to be fixed in the pure Python version as of at least 3.6:
Python 3.6.7 (default, Oct 25 2018, 16:11:17) 
[GCC 8.2.1 20180831] on linux
>>> import sys
>>> sys.modules['_datetime'] = None
>>> from decimal import Decimal as D
>>> from datetime import datetime
>>> datetime.utcfromtimestamp(D(123456.12345))
datetime.datetime(1970, 1, 2, 10, 17, 36, 123450)
But the truncation behavior is still present in the C version as of Python 3.8.0a1+:
Python 3.8.0a1+ (heads/master:3766f18, Feb 11 2019, 12:52:31) 
[GCC 8.2.1 20181127] on linux
>>> from datetime import datetime
>>> from decimal import Decimal as D
>>> datetime.utcfromtimestamp(D(123456.12345))
datetime.datetime(1970, 1, 2, 10, 17, 36)
I still think we need a test for the constructor behavior, but I'm going to remove "easy", since we still need to fix truncation in the C version.
History
Date User Action Args
2019年02月27日 17:10:29p-gansslesetrecipients: + p-ganssle, lemburg, belopolsky, vstinner, SilentGhost, skrah, serhiy.storchaka, anglister, Steven Davidson
2019年02月27日 17:10:29p-gansslesetmessageid: <1551287429.2.0.116112410519.issue23607@roundup.psfhosted.org>
2019年02月27日 17:10:29p-gansslelinkissue23607 messages
2019年02月27日 17:10:29p-gansslecreate

AltStyle によって変換されたページ (->オリジナル) /