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

gh-148663: Document that IllegalMonthError inherits from both ValueError and IndexError by EoinTrial · Pull Request #148664 · python/cpython · GitHub

/ cpython Public

gh-148663: Document that IllegalMonthError inherits from both ValueError and IndexError - #148664

Merged
StanFromIreland merged 4 commits into
python:mainfrom
EoinTrial:fix/calendar-illegalmontherror-docs
Apr 23, 2026
Merged

gh-148663: Document that IllegalMonthError inherits from both ValueError and IndexError#148664
StanFromIreland merged 4 commits into
python:mainfrom
EoinTrial:fix/calendar-illegalmontherror-docs

Conversation

EoinTrial commented Apr 17, 2026
edited by github-actions Bot
Loading

Copy link
Copy Markdown
Contributor

The documentation for calendar.IllegalMonthError describes it only as "a subclass of ValueError", but the source code defines it as:

class IllegalMonthError(ValueError, IndexError):

The IndexError base class is intentional for backwards compatibility (see the source comment in Lib/calendar.py), but this is not mentioned in the docs. Users catching IndexError for bad month numbers won't know their code still works after Python 3.13.


📚 Documentation preview 📚: https://cpython-previews--148664.org.readthedocs.build/

python-cla-bot Bot commented Apr 17, 2026
edited
Loading

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

picnixz commented Apr 19, 2026

Copy link
Copy Markdown
Member
  1. Can you add a versionchanged directive indicating that this is now inheriting ValuerError and IndexError since 3.13 (I did not check when it was changed so pick the correct version).
  2. Reword the NEWS entry
  3. Add a test to ensure that we do not remove that double inheritance.

EoinTrial force-pushed the fix/calendar-illegalmontherror-docs branch from 58e98ba to 1781682 Compare April 19, 2026 14:32
EoinTrial requested a review from AA-Turner as a code owner April 19, 2026 14:32

Copy link
Copy Markdown
Contributor Author

@picnixz Thanks for taking a look! I've added the versionchanged:: 3.12 directive, rewritten the NEWS entry, and added test_illegal_month_error_bases to verify the dual inheritance.

Comment thread Doc/library/calendar.rst Outdated
Comment thread Doc/library/calendar.rst Outdated
Comment thread Doc/library/calendar.rst Outdated
Comment thread Lib/test/test_calendar.py Outdated
EoinTrial force-pushed the fix/calendar-illegalmontherror-docs branch from 1781682 to c4e2753 Compare April 19, 2026 16:46
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
EoinTrial requested a review from picnixz April 19, 2026 16:48

Copy link
Copy Markdown
Contributor Author

@picnixz Thanks very much for reviewing! What's the next step towards getting this merged? :)

picnixz commented Apr 21, 2026

Copy link
Copy Markdown
Member

I need to come back home so a week or so. In general, once it is approved by one core dev, if the change is minimal, it will be merged when they have time. On your side there is nothing to do (we will ourselves update the branch if necessary/

picnixz commented Apr 21, 2026

Copy link
Copy Markdown
Member

There are however some lint issues so could you fix them please?

Comment thread Doc/library/calendar.rst Outdated
Co-authored-by: Stan Ulbrych <stan@python.org>

StanFromIreland 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.

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

LGTM

StanFromIreland added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Apr 23, 2026
StanFromIreland merged commit 435be06 into python:main Apr 23, 2026
51 checks passed
github-project-automation Bot moved this from Todo to Done in Docs PRs Apr 23, 2026

Copy link
Copy Markdown

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

bedevere-app Bot commented Apr 23, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Apr 23, 2026

bedevere-app Bot commented Apr 23, 2026

Copy link
Copy Markdown

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

bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Apr 23, 2026

Copy link
Copy Markdown
Member

Merged, GRMA!

EoinTrial deleted the fix/calendar-illegalmontherror-docs branch April 23, 2026 16:41

Copy link
Copy Markdown
Contributor Author

@StanFromIreland Tá fáilte mhór romhat, a chara ;)

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
…from both `ValueError` and `IndexError` (python#148664)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request Apr 27, 2026
… from both `ValueError` and `IndexError` (GH-148664) (#148917)

(cherry picked from commit 435be06)

Co-authored-by: Eoin Shaughnessy <45000144+EoinTrial@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
StanFromIreland added a commit that referenced this pull request May 3, 2026
… from both `ValueError` and `IndexError` (GH-148664) (#148918)

(cherry picked from commit 435be06)

Co-authored-by: Eoin Shaughnessy <45000144+EoinTrial@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
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

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL