[Liblas-devel] Python leap year

Mateusz Loskot mateusz at loskot.net
Wed Aug 20 22:26:09 EDT 2008


Etienne Bellemare Racine wrote:
> Following the beta 2 announce, I've check the leap year definition in 
> python.
>> (- Python header code does not handle leap year correctly 
>> http://liblas.org/ticket/71 )
>>     48    def leap_year(year):
>>      49        if (year % 400) == 0:
>>      50            return True
>>      51        elif (year % 100) == 0:
>>      52            return True
>>      53        elif (year % 4) == 0:
>>      54            return True
>>      55        return False 
> I think it should be (and according to wikipedia : 
> http://en.wikipedia.org/wiki/Leap_year#Algorithm) :
>     51        elif (year % 100) == 0:
>     52            return *False*

Etienne,

Yes, IMO you are correct.

I've reopened Ticket 71 with appropriate note:

http://liblas.org/ticket/71#comment:2

Thank you for pointing this bug!

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org



More information about the Liblas-devel mailing list