Skip to content

Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4().#4079

Merged
abalkin merged 4 commits intopython:masterfrom
abalkin:issue-28292
Oct 24, 2017
Merged

Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4().#4079
abalkin merged 4 commits intopython:masterfrom
abalkin:issue-28292

Conversation

@abalkin
Copy link
Copy Markdown
Member

@abalkin abalkin commented Oct 23, 2017

Calendar.itermonthdates() will now consistently raise an exception when a date falls outside of the 0001-01-01 through 9999-12-31 range. To support applications that cannot tolerate such exceptions, the new methods itermonthdays3() and itermonthdays4() are added. The new methods return tuples and are not restricted by the range supported by datetime.date.

Thanks @serhiy-storchaka for suggesting the itermonthdays4() method and for the review.

https://bugs.python.org/issue28292

@abalkin abalkin changed the title Implemented Calendar.itermonthdays3() and itermonthdays4(). Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). Oct 23, 2017
@abalkin abalkin self-assigned this Oct 23, 2017
Copy link
Copy Markdown
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but needs a documentation.

Comment thread Lib/calendar.py
for i, d in enumerate(self.itermonthdays(year, month), self.firstweekday):
yield d, i % 7

def itermonthdays3(self, year, month):
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of methods: itermonthdays2, itermonthdays3, itermonthdays4, itermonthdays looks slightly inconsistent.

@abalkin abalkin merged commit fdd9b21 into python:master Oct 24, 2017
@abalkin abalkin deleted the issue-28292 branch October 24, 2017 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants