Alexander Belopolsky added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28292>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to