Message170854
Hi Cédric!
while True:
yield date
- date += oneday
+ try:
+ date += oneday
+ except OverflowError:
+ break
You might add a comment explaining why we may get an OverflowError here.
I don't know the cost of adding a try/except in a loop. But the loop has 31 iterations or less, so it's maybe better to keep the explicit try/except around date += oneday.
+ def test_itermonthdates(self):
+ # ensure itermonthdates works for all months
+ list(calendar.Calendar().itermonthdates(9999, 12))
Please use datetime.MAXYEAR instead of this hardcoded constant. |
|
Date |
User |
Action |
Args |
2012-09-20 21:43:10 | vstinner | set | recipients:
+ vstinner, skip.montanaro, rhettinger, terry.reedy, belopolsky, ezio.melotti, ced |
2012-09-20 21:43:10 | vstinner | set | messageid: <1348177390.66.0.222125606041.issue15421@psf.upfronthosting.co.za> |
2012-09-20 21:43:10 | vstinner | link | issue15421 messages |
2012-09-20 21:43:09 | vstinner | create | |
|