This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Created on 2022-01-05 09:38 by sobolevn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30412 merged sobolevn, 2022-01-05 09:52
PR 30424 merged miss-islington, 2022-01-05 20:22
Messages (7)
msg409742 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-05 09:38
For some reasons useful day constants (`MONDAY` ... `SUNDAY`) from `calendar` are not properly recognised. Several problems: 0. Not all code inside uses these constants 1. They are not tested. Only `.MONDAY` and `.SUNDAY` are tested to be present in https://github.com/python/cpython/blob/main/Lib/test/test_calendar.py#L508-L511 2. They are not in `__all__` 3. They are partially documented. There are some notes about them in https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday > Sets the weekday (0 is Monday, 6 is Sunday) to start each week. The values :const:`MONDAY`, :const:`TUESDAY`, :const:`WEDNESDAY`, :const:`THURSDAY`, :const:`FRIDAY`, :const:`SATURDAY`, and :const:`SUNDAY` are provided for convenience. For example, to set the first weekday to Sunday: > import calendar > calendar.setfirstweekday(calendar.SUNDAY) But, they are not clickable, because, for example, ":const:`MONDAY`" does not exist in docs index. So, my plan is: 0. Improve constant usage in the source code to make it more readable 1. Test that constants are there 2. Add them to `__all__` as a part of public API 3. Improve their docs
msg409786 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-05 16:51
I don't think these were intended to be public. like "January" and "February", they were for internal use. Presumably, this is because the names vary across languages. In the absence of some demonstrated user need, we should leave this alone.
msg409789 - (view) Author: Nikita Sobolev (sobolevn) * (Python triager) Date: 2022-01-05 17:04
> I don't think these were intended to be public. Thanks for the feedback! The problem is they are documented here: https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Should we change the docs there to hide them as implementation detail? Because the current state looks inconsistent to me.
msg409793 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-05 18:20
> The problem is they are documented here: > https://docs.python.org/3/library/calendar.html#calendar.setfirstweekday Well, that does make them public, so we have to go forward.
msg409804 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-05 20:21
 New changeset e5894ca8fd05e6a6df1033025b9093b68baa718d by Nikita Sobolev in branch 'main': bpo-46266: Add calendar day of week constants to __all__ (GH-30412) https://github.com/python/cpython/commit/e5894ca8fd05e6a6df1033025b9093b68baa718d 
msg409805 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2022-01-05 20:22
Thanks for the PR. Sorry that I missed the one public reference in the docs.
msg411324 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2022-01-23 01:00
 New changeset f66ef3eab62c6d262ddbc8ab16fb43c8921ad33a by Miss Islington (bot) in branch '3.10': bpo-46266: Add calendar day of week constants to __all__ (GH-30412) (GH-30424) https://github.com/python/cpython/commit/f66ef3eab62c6d262ddbc8ab16fb43c8921ad33a 
History
Date User Action Args
2022-04-11 14:59:54adminsetgithub: 90424
2022-01-23 01:00:14vstinnersetnosy: + vstinner
messages: + msg411324
2022-01-05 20:22:45miss-islingtonsetnosy: + miss-islington

pull_requests: + pull_request28629
2022-01-05 20:22:13rhettingersetstatus: open -> closed

resolution: fixed
messages: + msg409805
versions: - Python 3.9, Python 3.10
2022-01-05 20:21:08rhettingersetmessages: + msg409804
2022-01-05 18:20:01rhettingersetstatus: closed -> open
resolution: rejected -> (no value)
messages: + msg409793
2022-01-05 17:04:51sobolevnsetmessages: + msg409789
2022-01-05 16:52:23rhettingersetstatus: open -> closed
resolution: rejected
stage: patch review -> resolved
2022-01-05 16:51:35rhettingersetassignee: rhettinger

messages: + msg409786
nosy: + rhettinger
2022-01-05 09:52:26sobolevnsetkeywords: + patch
stage: patch review
pull_requests: + pull_request28618
2022-01-05 09:38:22sobolevncreate