I'm not sure the rationale behind this. That is, the rationale section of the proposal does a poor just of explaining any case where this is actually a problem.<p>In every case where I've seen this problem, it's a matter of people either not storing the timezone along with the local time, or not storing in UTC time. A local time with a timezone is a unique time, it does not occur twice. A UTC time additionally does not occur twice. Store a time zone along with the date and time or store in UTC and convert on use.<p>Note: If there are instances where a second is repeated, it's rare special occurrence that developing a formalized interface for seems like overkill.
Terrible PEP, I hope it gets rejected. One-off flags like this are hacks that shouldn't be in stdlib. It simply stinks, in an area (time handling) where the stdlib does not really smell like roses already.<p>Dealing with time adjustments is the OS's job, not userland. If your job has to be scheduled exactly and cannot rely on the OS, and you refuse to deal with UTC, it's your own damn fault and you can always just use a long-running process with timers.
So :<p>Time in UK is currently UTC +1 (BST)
At 2am on 25 OCT we will return to GMT / UTC. It will therefore become 1am, and for the next hour all times will have happened before<p>The idea is to put a bit flag that says "alreadyseenthistime"<p>It seems to me this is a solution to the wrong problem.<p>Store all strings as bytes, assuming UTF-8, store all times as longs assuming UTC<p>If we convert all python datelines to non-naive (ie embedded with a TZ) then we are forced always to choose an encoding just like in strings. The right encoding is to always assume incoming dates are UTC, to throw error if they are non naive, and to assume that local clocks are set correctly (which we do anyway)<p>I need to read it more carefully - but it seems the wrong solution
When the clocks change, don't you shift timezone? There aren't duplicate times in BST, we just switch from GMT to BST and then back.<p>> In these situations, the information displayed on a local clock (or stored in a Python datetime instance) is insufficient to identify a particular moment in time.<p>Does the datetime instance not store the timezone?
The more I'm exposed to other date/time libraries, the more impressed I become with Apple's date/time library.<p><a href="https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/DatesAndTimes/DatesAndTimes.html#//apple_ref/doc/uid/10000039-SW1" rel="nofollow">https://developer.apple.com/library/mac/documentation/Cocoa/...</a>