Skip to content

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

gh-108202: Document calendar.Calendar.firstweekday#128566
erlend-aasland merged 4 commits into
python:mainfrom
erlend-aasland:docs/calendar-firstweekday-attr

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Jan 6, 2025

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/

@eendebakpteendebakpt 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.

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)

@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

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.

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.

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
ContributorAuthor

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.

@erlend-aasland
erlend-aasland merged commit b3cbd8f into python:mainJan 7, 2025
@erlend-aasland
erlend-aasland deleted the docs/calendar-firstweekday-attr branch January 7, 2025 07:59
@miss-islington-app

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>
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks for the reviews, everyone!

@bedevere-app

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-appbedevere-appBot removed the needs backport to 3.13 bugs and security fixes label Jan 7, 2025
@bedevere-app

Copy link
Copy Markdown

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

@bedevere-appbedevere-appBot 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
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsDocumentation in the Doc dirskip news

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants

@erlend-aasland@eendebakpt@hugovk@ZeroIntensity