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 serhiy.storchaka
Recipients SilentGhost, belopolsky, lemburg, serhiy.storchaka, skrah, vstinner
Date 2015-03-30.13:48:12
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1427723292.19.0.782698531637.issue23607@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is that the Decimal *was* supported in 2.7. So this issue can be considered not as adding new feature, but as fixing a regression. But changes are too large for just bugfix.

> It would be more consistent to support decimal.Decimal nowhere or "everywhere". IMO the new _PyTime_FromSecondsObject() (very close to _PyTime_ObjectToDenominator, but using time_t) should also be patched.

Will add Decimal support in all functions in Python/pytime.c that support floats.

> Please add some tests for decimal.Decimal in test_time directly. Usually, I try to test rounding and overflow. Testing for overflow is not always possible because it may depend on the platform.

Will do.

> Is the patch context insensitive?

No, the patch is context sensitive. I think the end user is responsible to set an appropriate context if it want to create a datetime from Decimal timestamp. At least until we add functions that return Decimal.
History
Date User Action Args
2015-03-30 13:48:12serhiy.storchakasetrecipients: + serhiy.storchaka, lemburg, belopolsky, vstinner, SilentGhost, skrah
2015-03-30 13:48:12serhiy.storchakasetmessageid: <1427723292.19.0.782698531637.issue23607@psf.upfronthosting.co.za>
2015-03-30 13:48:12serhiy.storchakalinkissue23607 messages
2015-03-30 13:48:12serhiy.storchakacreate