[Python-ideas] Date/time literals

Eric Smith eric at trueblade.com
Wed Jun 2 16:21:47 CEST 2010


Nick Coghlan wrote:

> The case for allowing a "60" value for seconds in the datetime 
> constructor seems reasonable to me (i.e. prevent leap seconds from 
> breaking date parsing), but I don't see the use case for delaying 
> normalisation to a valid POSIX time.
> 
> If the constructor just converts the 60 to a zero and adds 1 minute 
> immediately, then the chance of subtle breakages would be minimal and 
> the current ValueError would be replaced by a far more graceful behaviour.

I think this is the best we can do and not get sucked into supporting 
leap seconds.

> (Allowing 2400 hours just seems plain odd to me, but if it was adopted 
> I'd suggest immediate normalisation be similarly applied in that case as 
> well).

I'm not as concerned about this, but I've had occasions where it would 
have been handy.

-- 
Eric.



More information about the Python-ideas mailing list