Title: Docs: `calendar.calendar` and `calendar.prcal` document parameter as `year` but it is named `theyear` · Issue #153926 · python/cpython · GitHub
Open Graph Title: Docs: `calendar.calendar` and `calendar.prcal` document parameter as `year` but it is named `theyear` · Issue #153926 · python/cpython
X Title: Docs: `calendar.calendar` and `calendar.prcal` document parameter as `year` but it is named `theyear` · Issue #153926 · python/cpython
Description: Documentation The module-level functions calendar.calendar() and calendar.prcal() document their first parameter as year: .. function:: prcal(year, w=0, l=0, c=6, m=3) .. function:: calendar(year, w=2, l=1, c=6, m=3) However, both are bo...
Open Graph Description: Documentation The module-level functions calendar.calendar() and calendar.prcal() document their first parameter as year: .. function:: prcal(year, w=0, l=0, c=6, m=3) .. function:: calendar(year, ...
X Description: Documentation The module-level functions calendar.calendar() and calendar.prcal() document their first parameter as year: .. function:: prcal(year, w=0, l=0, c=6, m=3) .. function:: calendar(year, ...
Opengraph URL: https://github.com/python/cpython/issues/153926
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Docs: `calendar.calendar` and `calendar.prcal` document parameter as `year` but it is named `theyear`","articleBody":"# Documentation\n\nThe module-level functions [`calendar.calendar()`](https://docs.python.org/3/library/calendar.html#calendar.calendar) and [`calendar.prcal()`](https://docs.python.org/3/library/calendar.html#calendar.prcal) document their first parameter as `year`:\n\n```rst\n.. function:: prcal(year, w=0, l=0, c=6, m=3)\n\n.. function:: calendar(year, w=2, l=1, c=6, m=3)\n```\n\nHowever, both are bound methods of the module's `TextCalendar` instance (`calendar = c.formatyear`, `prcal = c.pryear` in `Lib/calendar.py`), whose first parameter is named `theyear`:\n\n```pycon\n>>> import calendar, inspect\n>>> inspect.signature(calendar.calendar)\n\u003cSignature (theyear, w=2, l=1, c=6, m=3)>\n>>> inspect.signature(calendar.prcal)\n\u003cSignature (theyear, w=0, l=0, c=6, m=3)>\n```\n\nAs a result the documented keyword name does not work — `calendar.calendar(year=2025)` raises `TypeError`, while `calendar.calendar(theyear=2025)` succeeds.\n\nThe documentation should be updated to use the real parameter name `theyear`, which also matches the sibling `month()` and `prmonth()` functions documented just above.\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-153927\n* gh-153937\n* gh-153938\n* gh-153939\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/fedonman","@type":"Person","name":"fedonman"},"datePublished":"2026-07-18T11:43:29Z","url":"https://github.com/python/cpython/issues/153926"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a891c1d2-857e-e255-7eec-932d42e7a27d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 80CA:3F90DC:3A74B2:5049EE:6AECCA5C |
| html-safe-nonce | 1eacfa68605c1a0f03214588d43a5322b17df06a25ad5ea8c023a0d0adbcb00f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MENBOjNGOTBEQzozQTc0QjI6NTA0OUVFOjZBRUNDQTVDIiwidmlzaXRvcl9pZCI6IjIwODg5MTY2ODk3NjY2MzIwMjgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 65e0cae6160b4ade355636fc146ca593e4217196910eb41ba7a19df92db9c54e |
| hovercard-subject-tag | issue:4918096450 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/153926/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f2a2ce39cca0d3664a853ba69761d2a8e5d1a529f7aec6cfef4245e836b60e7a/python/cpython/issues/153926 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f2a2ce39cca0d3664a853ba69761d2a8e5d1a529f7aec6cfef4245e836b60e7a/python/cpython/issues/153926 |
| og:image:alt | Documentation The module-level functions calendar.calendar() and calendar.prcal() document their first parameter as year: .. function:: prcal(year, w=0, l=0, c=6, m=3) .. function:: calendar(year, ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | fedonman |
| hostname | github.com |
| expected-hostname | github.com |
| None | dc0b519c5798dc1150b88dc4c06a8b9634d0069218dc04e469970e76aad74016 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | db139f0bf57b59bf9a8c4abb0849924d6c6ca559 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width