FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-108202: Document calendar.Calendar.firstweekday by erlend-aasland · Pull Request #128566 · python/cpython · GitHub

Repository navigation

gh-108202: Document calendar.Calendar.firstweekday - #128566

Merged
erlend-aasland merged 4 commits into
python:mainfrom
erlend-aasland:docs/calendar-firstweekday-attr
Jan 7, 2025
Merged

erlend-aasland merged 4 commits into
python:mainfrom
erlend-aasland:docs/calendar-firstweekday-attr

Conversation

erlend-aasland commented Jan 6, 2025 •
edited
Loading

Copy link
Copy Markdown
Contributor

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/

eendebakpt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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)

Copy link
Copy Markdown
Contributor Author

I noticed, but double dash is used for many other ranges in this file. Amending all of those can be left for another PR.

Comment thread Doc/library/calendar.rst

This property can also be set and read using
:meth:`~Calendar.setfirstweekday` and
:meth:`~Calendar.getfirstweekday` respectively.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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 :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

erlend-aasland merged commit b3cbd8f into python:main Jan 7, 2025
erlend-aasland deleted the docs/calendar-firstweekday-attr branch January 7, 2025 07:59

Copy link
Copy Markdown

Thanks @erlend-aasland for the PR 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 7, 2025
…8566)

(cherry picked from commit b3cbd8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>

Copy link
Copy Markdown
Contributor Author

Thanks for the reviews, everyone!

bedevere-app Bot commented Jan 7, 2025

Copy link
Copy Markdown

GH-128579 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jan 7, 2025
…8566)

(cherry picked from commit b3cbd8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jan 7, 2025

bedevere-app Bot commented Jan 7, 2025

Copy link
Copy Markdown

GH-128580 is a backport of this pull request to the 3.12 branch.

bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jan 7, 2025
erlend-aasland added a commit that referenced this pull request Jan 7, 2025
…#128579)

(cherry picked from commit b3cbd8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
erlend-aasland added a commit that referenced this pull request Jan 7, 2025
…#128580)

(cherry picked from commit b3cbd8f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation in the Doc dir skip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL