Just checking my E-mail coming back from holidays, I see: diff -C2 -r1.17 -r1.18 *** calendar.py 2000/08/30 14:01:28 1.17 --- calendar.py 2000/10/09 12:42:04 1.18 *************** *** 55,60 **** def leapdays(y1, y2): """Return number of leap years in range [y1, y2). ! Assume y1 <= y2 and no funny (non-leap century) years.""" ! return (y2+3)/4 - (y1+3)/4 def weekday(year, month, day): --- 55,62 ---- def leapdays(y1, y2): """Return number of leap years in range [y1, y2). ! Assume y1 <= y2.""" ! y1 -= 1 ! y2 -= 1 ! return (y2/4 - y1/4) - (y2/100 - y1/100) + (y2/400 - y1/400) def weekday(year, month, day): I am worried about the use of "-=" here. The code basically says: "if the arguments are mutable numeric types, I'd like to modify them in place". In c.l.py it has been stressed multiple times that "-=" is not the same as "= -". I think this is clearly a place where "= -" is preferable over "-=". Even though you might think people will always call this with python integers, you can never be sure enough. Rob -- ===== rob@hooft.net http://www.hooft.net/people/rob/ ===== ===== R&D, Nonius BV, Delft http://www.nonius.nl/ ===== ===== PGPid 0xFA19277D ========================== Use Linux! =========
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4