Message239608
| 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. |
|