Author serhiy.storchaka
Recipients belopolsky, jiangping.li, rhettinger, serhiy.storchaka, xiang.zhang
Date 2016-09-28.05:24:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475040246.2.0.49970330389.issue28292@psf.upfronthosting.co.za>
In-reply-to
Content
Possible solutions (in any case the documentation needs changes):

1. Raise OverflowError at both ends (revert issue15421patch). The method becomes unusable for two extreme months.

2. Yield an incomplete week at both ends (apply the patch from issue26650). This can cause silent producing incorrect result in third-party programs.

3. Yield None for unrepresentable dates. This is more useful than raising OverflowError, and noisily fails, but third-party code should be changed to support extreme cases.

4. Yield dummy date instance for unrepresentable dates (apply the patch from issue28253). If we are lucky, the third-party code will just work, without any changes. If we are not lucky, this makes debugging harder.

5. Make datetime.date supporting a date outside current limits. This is a can of worms (numbering years B.D., output and parsing dates with negative and more than 4-digit years).

Examples of the usage of itermonthdates():

https://github.com/sunlightlabs/django-locksmith/blob/master/locksmith/hub/dataviews.py
https://github.com/quandyfactory/Quandy/blob/master/quandy.py
https://github.com/takanory/plone.app.event/blob/master/plone/app/event/portlets/portlet_calendar.py
https://github.com/gerow/gnome-shell-google-calendar/blob/master/gnome-shell-google-calendar.py
https://bitbucket.org/benallard/msgboard/src/1c08fa3ba040f8151d0e28130b01b30e0595e448/msgboard/controller.py?at=default
History
Date User Action Args
2016-09-28 05:24:06serhiy.storchakasetrecipients: + serhiy.storchaka, rhettinger, belopolsky, xiang.zhang, jiangping.li
2016-09-28 05:24:06serhiy.storchakasetmessageid: <1475040246.2.0.49970330389.issue28292@psf.upfronthosting.co.za>
2016-09-28 05:24:06serhiy.storchakalinkissue28292 messages
2016-09-28 05:24:05serhiy.storchakacreate