Serhiy Storchaka added the comment: 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 ---------- _______________________________________ 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