[Python-Dev] RE: [Python-checkins] python/dist/src/Lib _strptime.py, 1.35, 1.36

Brett C. bac at OCF.Berkeley.EDU
Mon Oct 18 23:17:18 CEST 2004


Erik Andersén wrote:
> Tony Meyer wrote:

>>>>>time.strptime("2008 51 1", "%Y %U %w")
>>>>>        
>>>>>
>>(2008, 12, 22, 0, 0, 0, 0, 357, -1)
>>
>>Wouldn't December 29 2008 be the right answer? This is the result without
>>that if:
>>
>>  
>>
> Yes, according to the Python documentation. You should however be aware 
> that this is different from the standard  (ISO 8601:2000).
> According to that standard, Monday, week 52, 2008 is December 22. 
> Implementing a function that gives result different from what people
> actually use is not very good. It is better to leave it unimplemented.

The function has a bug and is not trying to implement something other than what 
people are expecting.  Having a Julian date that is out of range is my fault in 
the algorithm and in no way would happen if you passed it in directly.

And any more discussion on this bug or this algorithm should go on the bug 
report (http://www.python.org/sf/1045381) and not on python-dev.

-Brett


More information about the Python-Dev mailing list