Skip to content

gh-153853: Fix parameter name of calendar.setfirstweekday() in docs#153851

Merged
brettcannon merged 1 commit into
python:mainfrom
IbrahimShaqqou:patch-1
Jul 17, 2026
Merged

gh-153853: Fix parameter name of calendar.setfirstweekday() in docs#153851
brettcannon merged 1 commit into
python:mainfrom
IbrahimShaqqou:patch-1

Conversation

@IbrahimShaqqou

@IbrahimShaqqou IbrahimShaqqou commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

The module-level function is documented as setfirstweekday(weekday), but the implementation in Lib/calendar.py is def setfirstweekday(firstweekday). The parameter can be passed by keyword, so the documented signature fails:

>>> import calendar
>>> calendar.setfirstweekday(weekday=calendar.SUNDAY)
Traceback (most recent call last):
  ...
TypeError: setfirstweekday() got an unexpected keyword argument 'weekday'
>>> calendar.setfirstweekday(firstweekday=calendar.SUNDAY)  # OK

This also makes the entry consistent with Calendar.setfirstweekday(firstweekday) documented earlier in the same file, and with the Calendar(firstweekday=0) constructor and the calendar.firstweekday() accessor.

Docs-only change; per the contributing guidelines, no issue for trivial fixes (skip issue).

@python-cla-bot

python-cla-bot Bot commented Jul 17, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app bedevere-app Bot added docs Documentation in the Doc dir skip news labels Jul 17, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Docs PRs Jul 17, 2026
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33637099 | 📁 Comparing 57ac409 against main (9d231cb)

  🔍 Preview build  

1 file changed
± library/calendar.html

@IbrahimShaqqou IbrahimShaqqou changed the title Docs: Fix parameter name of calendar.setfirstweekday() gh-153853: Fix parameter name of calendar.setfirstweekday() in docs Jul 17, 2026
@brettcannon brettcannon added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes needs backport to 3.15 pre-release feature fixes, bugs and security fixes labels Jul 17, 2026
@brettcannon
brettcannon merged commit 1736526 into python:main Jul 17, 2026
46 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 17, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @IbrahimShaqqou for the PR, and @brettcannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

GH-153859 is a backport of this pull request to the 3.15 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 17, 2026
@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

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

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 17, 2026
@bedevere-app

bedevere-app Bot commented Jul 17, 2026

Copy link
Copy Markdown

GH-153860 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 17, 2026
brettcannon pushed a commit that referenced this pull request Jul 17, 2026
… docs (GH-153851) (#153861)

gh-153853: Fix parameter name of calendar.setfirstweekday() in docs (GH-153851)
(cherry picked from commit 1736526)

Co-authored-by: Ibrahim Shaqqou <101660458+IbrahimShaqqou@users.noreply.github.com>
brettcannon pushed a commit that referenced this pull request Jul 17, 2026
… docs (GH-153851) (#153860)

gh-153853: Fix parameter name of calendar.setfirstweekday() in docs (GH-153851)
(cherry picked from commit 1736526)

Co-authored-by: Ibrahim Shaqqou <101660458+IbrahimShaqqou@users.noreply.github.com>
brettcannon pushed a commit that referenced this pull request Jul 17, 2026
… docs (GH-153851) (#153859)

gh-153853: Fix parameter name of calendar.setfirstweekday() in docs (GH-153851)
(cherry picked from commit 1736526)

Co-authored-by: Ibrahim Shaqqou <101660458+IbrahimShaqqou@users.noreply.github.com>
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.

2 participants