-
-
Notifications
You must be signed in to change notification settings - Fork 31.7k
gh-108202: Document calendar.Calendar.firstweekday #128566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-108202: Document calendar.Calendar.firstweekday #128566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Either 0-6 or 0--6 would be fine with me, but to be consistent: there is one more 0-6 in the file (for IllegalWeekdayError
)
I noticed, but double dash is used for many other ranges in this file. Amending all of those can be left for another PR. |
|
||
This property can also be set and read using | ||
:meth:`~Calendar.setfirstweekday` and | ||
:meth:`~Calendar.getfirstweekday` respectively. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth recommending usage of either the attribute or the methods, per the zen:
There should be one-- and preferably only one --obvious way to do it.
If you want though, I'm fine to leave it as is. I'm just being nitpicky :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that, but I think the zen train already left the calendar module API :) IMO, a better approach would be to soft deprecate the set/get method pair.
Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13. |
Thanks for the reviews, everyone! |
GH-128579 is a backport of this pull request to the 3.13 branch. |
GH-128580 is a backport of this pull request to the 3.12 branch. |
Follow-up to #127579. I think we should promote the more pythonic property API, rather than the setter/getter pair.
📚 Documentation preview 📚: https://cpython-previews--128566.org.readthedocs.build/