[Liblas-devel] Python leap year

Etienne Bellemare Racine etiennebr at gmail.com
Wed Aug 20 20:33:52 EDT 2008


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/liblas-devel/attachments/20080820/757fd787/attachment.html


More information about the Liblas-devel mailing list