Author belopolsky
Recipients belopolsky, jiangping.li, rhettinger, serhiy.storchaka, xiang.zhang
Date 2016-09-28.16:26:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475079988.2.0.491598861805.issue28292@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-09-28 16:26:28belopolskysetrecipients: + belopolsky, rhettinger, serhiy.storchaka, xiang.zhang, jiangping.li
2016-09-28 16:26:28belopolskysetmessageid: <1475079988.2.0.491598861805.issue28292@psf.upfronthosting.co.za>
2016-09-28 16:26:28belopolskylinkissue28292 messages
2016-09-28 16:26:27belopolskycreate