[New-bugs-announce] [issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

Alexander Belopolsky report at bugs.python.org
Tue Sep 27 23:01:58 EDT 2016


New submission from Alexander Belopolsky:

The Calendar.itermonthdates() method is defined as follows:

"Return an iterator for one month. The iterator will yield datetime.date values and will always iterate through complete weeks, so it will yield dates outside the specified month."

However, for the two months at the extremes of datetime.date range, 0001-01 and 9999-12, the dates outside the specified month may not be representable as datetime.date instances.

The current implementation is inconsistent: itermonthdates(1, 1) may raise an OverflowError (see #26650), while itermonthdates(9999, 12) may yield an incomplete week (see #28253.)

This issue supersedes #26650 and #28253.

----------
assignee: belopolsky
messages: 277577
nosy: belopolsky, jiangping.li, rhettinger, serhiy.storchaka, xiang.zhang
priority: normal
severity: normal
stage: test needed
status: open
title: Make Calendar.itermonthdates() behave consistently in edge cases
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28292>
_______________________________________


More information about the New-bugs-announce mailing list