Message239608
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. |
|
Date |
User |
Action |
Args |
2015-03-30 13:48:12 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, lemburg, belopolsky, vstinner, SilentGhost, skrah |
2015-03-30 13:48:12 | serhiy.storchaka | set | messageid: <1427723292.19.0.782698531637.issue23607@psf.upfronthosting.co.za> |
2015-03-30 13:48:12 | serhiy.storchaka | link | issue23607 messages |
2015-03-30 13:48:12 | serhiy.storchaka | create | |
|