Message318743
So I created a little patch for this, and when I was working on it I realized that it's actually possible to implement full `fold` support in a generic way in `fromutc` under the assumption that `utcoffset - dst` holds at all points (which is the fundamental assumption of the builtin `fromutc` function).
It adds a bit of overhead, but I think any current fold-aware operations need to be implemented in pure Python anyway (and involve even more overhead), so I think it would be a net gain.
The big downside I see here is that it cannot take advantage of any sort of "is_ambiguous" function and has to rely on the method of "change the fold and see if the answer is different" to determine ambiguity. I think this is a small cost to pay for a generic implementation, though. I'm pretty busy this week and next week will be hectic too, but towards the end of the month I can probably come up with a test suite for this and look at some actual performance numbers. |
|
Date |
User |
Action |
Args |
2018-06-05 12:32:45 | p-ganssle | set | recipients:
+ p-ganssle, tim.peters, belopolsky |
2018-06-05 12:32:45 | p-ganssle | set | messageid: <1528201965.32.0.592728768989.issue28602@psf.upfronthosting.co.za> |
2018-06-05 12:32:45 | p-ganssle | link | issue28602 messages |
2018-06-05 12:32:45 | p-ganssle | create | |
|