Skip to content

Add Python 3.15 calendar datetime and difflib updates#15729

Merged
JelleZijlstra merged 3 commits intopython:mainfrom
JelleZijlstra:codex/python315-calendar-difflib
May 8, 2026
Merged

Add Python 3.15 calendar datetime and difflib updates#15729
JelleZijlstra merged 3 commits intopython:mainfrom
JelleZijlstra:codex/python315-calendar-difflib

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Member

Summary

  • Add Python 3.15 calendar additions for standalone month names and HTMLCalendar.formatmonthpage.
  • Update renamed 3.15 datetime ISO/strptime positional-only parameters, including datetime.fromisoformat.
  • Add difflib.unified_diff(color=...).
  • Remove corresponding 3.15 stubtest allowlist entries.

Relevant report entries

@github-actions

This comment has been minimized.

@JelleZijlstra JelleZijlstra marked this pull request as ready for review May 8, 2026 20:05
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Comment thread stdlib/calendar.pyi
Comment on lines +224 to +225
standalone_month_name: Sequence[str]
standalone_month_abbr: Sequence[str]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The situation here is more complicated. There are instances of _localized_month, which isn't a full Sequence, but has other format field. Same actually for month_name and month_abbr. day_name and day_abbr are not instances of _localized_day. But the latter has been true since at least 3.10, so I'm fine with using Sequence in this PR, although I would prepare a followup, changing these fields.

Another thing I noticed, although that's probably legacy and possibly also out of scope: Through __getattr__, this module has two constants "January" (equaling 1), and "February" (equaling 2).

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I'll prepare a followup for this.

Regarding the __getattr__, seems better to keep those out of the stub unless someone really needs them.

@JelleZijlstra JelleZijlstra merged commit f74b24b into python:main May 8, 2026
56 checks passed
@JelleZijlstra JelleZijlstra deleted the codex/python315-calendar-difflib branch May 8, 2026 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants