Add Python 3.15 calendar datetime and difflib updates#15729
Add Python 3.15 calendar datetime and difflib updates#15729JelleZijlstra merged 3 commits intopython:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
…endar-difflib # Conflicts: # stdlib/@tests/stubtest_allowlists/py315.txt
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
| standalone_month_name: Sequence[str] | ||
| standalone_month_abbr: Sequence[str] |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
Summary
calendaradditions for standalone month names andHTMLCalendar.formatmonthpage.datetimeISO/strptime positional-only parameters, includingdatetime.fromisoformat.difflib.unified_diff(color=...).Relevant report entries
calendar.standalone_month_name,calendar.standalone_month_abbr, andHTMLCalendar.formatmonthpage()(CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/calendar.py)datetimeISO/strptime positional-only parameters tostring(CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Modules/_datetimemodule.c)difflib.unified_diff(color=...)(CPython PR: gh-133722: Add Difflib theme to_colorizeand 'color' option todifflib.unified_diffcpython#133725; source: https://github.com/python/cpython/blob/main/Lib/difflib.py)