[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-08-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset 0c16f6b307f7607e29b98b8fbb99cbca28f91a48 by Raymond Hettinger (Miss Islington (bot)) in branch '3.8': bpo-28292: Mark calendar.py helper functions as private. (GH-15113) (GH-15116) https://github.com/python/cpython/commit/0c16f6b307f7607e29b9

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-08-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-08-04 Thread Raymond Hettinger
Raymond Hettinger added the comment: New changeset b1c8ec010fb4eb2654ca994e95144c8f2fea07fb by Raymond Hettinger in branch 'master': bpo-28292: Mark calendar.py helper functions as private. (GH-15113) https://github.com/python/cpython/commit/b1c8ec010fb4eb2654ca994e95144c8f2fea07fb

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-08-04 Thread miss-islington
Change by miss-islington : -- pull_requests: +14857 pull_request: https://github.com/python/cpython/pull/15116 ___ Python tracker ___ __

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-08-04 Thread Raymond Hettinger
Change by Raymond Hettinger : -- pull_requests: +14855 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/15113 ___ Python tracker ___ ___

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-13 Thread Kyle Stanley
Kyle Stanley added the comment: >But we have precedent in this module and should maintain it. In general, applying different rules to standard library modules and changing private function naming conventions on a case-by-case basis creates rather drastic inconsistency. There definitely shoul

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-13 Thread Raymond Hettinger
Raymond Hettinger added the comment: > Do you propose to change them all? No. But we have precedent in this module and should maintain it. FWIW, there are a number of modules that have been conscientious in this regard (for example, collections and random). -- ___

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are hundreds or thousands of private names in other modules. Do you propose to change them all? I afraid that this will cause more harm than benefit. -- ___ Python tracker

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: s/help/dir/ -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: For people using "import calendar", the __all__ variable has no effect. Running help(calendar) shows the functions as if they were public functions. The module historically hid its private details with the leading underscores. The patch in question vio

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: There are two ways to indicate that a function is not public: either make its name underscored, or add __all__ and do not include the function name in it. The purpose of __all__ is to avoid mass renaming of internal functions whis is a code churn and reduc

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2019-07-12 Thread Raymond Hettinger
Raymond Hettinger added the comment: Please mark all the non-public helper functions as being private by using a leading underscore for their names. The __all__ listing is correct but is insufficient. Note, the module already used the leading underscore convention for the some of the non-p

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-24 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: New changeset fdd9b217c60b454ac6a82f02c8b0b551caeac88b by Alexander Belopolsky in branch 'master': Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). (#4079) https://github.com/python/cpython/commit/fdd9b217c60b454ac6a82f02c8b

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I submitted PR 4079. Serhiy, please review the logic and if this matches what we discussed a year ago, I will add the docs and NEWS entries. -- ___ Python tracker

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- keywords: +patch pull_requests: +4049 stage: needs patch -> patch review ___ Python tracker ___ _

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > 1. Raise OverflowError at both ends (revert issue15421patch). The method > becomes unusable for two extreme months. The issue 15421 patch was committed in 85710a40e7e9eab86060bedc3762ccf9ca8d26ca. -- ___ Py

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Let me look into this. It's been a while ... -- ___ Python tracker ___ ___ Python-bugs-list

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2017-10-22 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mind to create a pull request Alexander? -- components: +Library (Lib) stage: test needed -> needs patch ___ Python tracker ___ _

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Maybe add also itermonthdays4() that yields 4-tuples (year, month, day, day_of_week)? I seen a code that filters out weekends from itermonthdates(). -- ___ Python tracker

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-28 Thread Alexander Belopolsky
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

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Serhiy Storchaka
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). T

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- dependencies: +calendar.prcal() output has a problem, calendar: OverflowErrors for year == 1 and firstweekday > 0 ___ Python tracker ___

[issue28292] Make Calendar.itermonthdates() behave consistently in edge cases

2016-09-27 Thread Alexander Belopolsky
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, f