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 belopolsky, p-ganssle, tim.peters
Date 2018-06-05.12:32:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1528201965.32.0.592728768989.issue28602@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2018-06-05 12:32:45p-gansslesetrecipients: + p-ganssle, tim.peters, belopolsky
2018-06-05 12:32:45p-gansslesetmessageid: <1528201965.32.0.592728768989.issue28602@psf.upfronthosting.co.za>
2018-06-05 12:32:45p-gansslelinkissue28602 messages
2018-06-05 12:32:45p-gansslecreate