Message277644
I would like to take the #1 approach, and also implement an itermonthdays3() generator that would be like itermonthdates(), but return 3-tuples (year, month, day) instead of datetime.date objects.
The name "itermonthdays3" is subject to discussion, but it fits with the existing "itermonthdays" and "itermonthdays2" that yield integers and 2-tuples respectively. An alternative, but slightly longer name would be "itermonthdatetuples".
itermonthdates() can then be reimplemented as
def itermonthdates(self, year, month):
for y, m, d in self.itermonthdays3(year, month):
yield datetime.date(y, m, d)
with the obvious out of bounds behavior. |
|
Date |
User |
Action |
Args |
2016-09-28 16:26:28 | belopolsky | set | recipients:
+ belopolsky, rhettinger, serhiy.storchaka, xiang.zhang, jiangping.li |
2016-09-28 16:26:28 | belopolsky | set | messageid: <1475079988.2.0.491598861805.issue28292@psf.upfronthosting.co.za> |
2016-09-28 16:26:28 | belopolsky | link | issue28292 messages |
2016-09-28 16:26:27 | belopolsky | create | |
|