Skip to content

gh-153926: Fix documented parameter name for calendar.calendar and calendar.prcal#153927

Merged
tomasr8 merged 3 commits into
python:mainfrom
fedonman:fix-gh-153926-calendar-theyear-docs
Jul 18, 2026
Merged

gh-153926: Fix documented parameter name for calendar.calendar and calendar.prcal#153927
tomasr8 merged 3 commits into
python:mainfrom
fedonman:fix-gh-153926-calendar-theyear-docs

Conversation

@fedonman

@fedonman fedonman commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

calendar.calendar() and calendar.prcal() document their first parameter as year, but both are bound methods of the module's TextCalendar instance (calendar = c.formatyear, prcal = c.pryear) whose first parameter is named theyear. Calling calendar.calendar(year=2025) therefore raises TypeError, while theyear=2025 works.

This updates the documentation to use the real parameter name theyear, which also matches the sibling month() and prmonth() functions documented just above.

Fixes #153926.

…and calendar.prcal

calendar.calendar() and calendar.prcal() are bound methods of the
module's TextCalendar instance, whose first parameter is named theyear,
but the documentation named it year, so the documented keyword raised
TypeError. Update the documentation to match the real signature, which
also matches the sibling month() and prmonth() functions.
@read-the-docs-community

read-the-docs-community Bot commented Jul 18, 2026

Copy link
Copy Markdown

Documentation build overview

📚 cpython-previews | 🛠️ Build #33645738 | 📁 Comparing 7553517 against main (bc2fd44)

  🔍 Preview build  

3 files changed
± library/calendar.html
± library/functions.html
± whatsnew/3.15.html

@tomasr8 tomasr8 left a comment

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.

Thank you @fedonman !

@tomasr8 tomasr8 added sprint 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 18, 2026
@github-project-automation github-project-automation Bot moved this to Todo in Sprint Jul 18, 2026
@github-project-automation github-project-automation Bot moved this from Todo to In Progress in Sprint Jul 18, 2026
@tomasr8
tomasr8 merged commit d12434b into python:main Jul 18, 2026
42 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Docs PRs Jul 18, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Sprint Jul 18, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @fedonman for the PR, and @tomasr8 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 18, 2026

Copy link
Copy Markdown

GH-153937 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 18, 2026
@bedevere-app

bedevere-app Bot commented Jul 18, 2026

Copy link
Copy Markdown

GH-153938 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 18, 2026
@bedevere-app

bedevere-app Bot commented Jul 18, 2026

Copy link
Copy Markdown

GH-153939 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 18, 2026
tomasr8 pushed a commit that referenced this pull request Jul 18, 2026
…r` and `calendar.prcal` (GH-153927) (#153937)

gh-153926: Fix documented parameter name for `calendar.calendar` and `calendar.prcal` (GH-153927)

gh-153926: Fix documented parameter name for calendar.calendar and calendar.prcal

calendar.calendar() and calendar.prcal() are bound methods of the
module's TextCalendar instance, whose first parameter is named theyear,
but the documentation named it year, so the documented keyword raised
TypeError. Update the documentation to match the real signature, which
also matches the sibling month() and prmonth() functions.
(cherry picked from commit d12434b)

Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
tomasr8 pushed a commit that referenced this pull request Jul 18, 2026
…r` and `calendar.prcal` (GH-153927) (#153939)

gh-153926: Fix documented parameter name for `calendar.calendar` and `calendar.prcal` (GH-153927)

gh-153926: Fix documented parameter name for calendar.calendar and calendar.prcal

calendar.calendar() and calendar.prcal() are bound methods of the
module's TextCalendar instance, whose first parameter is named theyear,
but the documentation named it year, so the documented keyword raised
TypeError. Update the documentation to match the real signature, which
also matches the sibling month() and prmonth() functions.
(cherry picked from commit d12434b)

Co-authored-by: Vyron Vasileiadis <hi@fedonman.com>
tomasr8 pushed a commit that referenced this pull request Jul 18, 2026
…r` and `calendar.prcal` (GH-153927) (#153938)

gh-153926: Fix documented parameter name for `calendar.calendar` and `calendar.prcal` (GH-153927)

gh-153926: Fix documented parameter name for calendar.calendar and calendar.prcal

calendar.calendar() and calendar.prcal() are bound methods of the
module's TextCalendar instance, whose first parameter is named theyear,
but the documentation named it year, so the documented keyword raised
TypeError. Update the documentation to match the real signature, which
also matches the sibling month() and prmonth() functions.
(cherry picked from commit d12434b)

Co-authored-by: Vyron Vasileiadis <hi@fedonman.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 sprint

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

Docs: calendar.calendar and calendar.prcal document parameter as year but it is named theyear

2 participants