Add Python 3.15 argparse ast and runtime updates#15736
Merged
JelleZijlstra merged 4 commits intopython:mainfrom May 9, 2026
Merged
Add Python 3.15 argparse ast and runtime updates#15736JelleZijlstra merged 4 commits intopython:mainfrom
JelleZijlstra merged 4 commits intopython:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
commented
May 9, 2026
| __match_args__ = ("key", "value", "generators") | ||
| key: expr | ||
| value: expr | ||
| if sys.version_info >= (3, 15): |
This comment has been minimized.
This comment has been minimized.
JelleZijlstra
commented
May 9, 2026
| self: Pattern[bytes], string: ReadableBuffer, pos: int = 0, endpos: int = sys.maxsize | ||
| ) -> Match[bytes] | None: ... | ||
| @overload | ||
| def prefixmatch(self, string: AnyStr, pos: int = 0, endpos: int = sys.maxsize) -> Match[AnyStr] | None: ... |
Member
Author
There was a problem hiding this comment.
I'm suspicious about this last overload, I think it allows some wrong calls through. But we already have the same for match(), so I'll leave it like this for now.
Collaborator
There was a problem hiding this comment.
should we just do prefixmatch = match? that's basically the impl
This comment has been minimized.
This comment has been minimized.
hauntsaninja
reviewed
May 9, 2026
|
|
||
| if sys.version_info >= (3, 15): | ||
| pass | ||
| elif sys.version_info >= (3, 13): |
Collaborator
There was a problem hiding this comment.
don't we usually "backport" deprecations? wondering if this can just be a single if sys.version_info <= (3, 13) branch (similar thing above as well)
hauntsaninja
approved these changes
May 9, 2026
Contributor
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add Python 3.15 stdlib updates for argparse, array, ast, faulthandler, re, shelve, tarfile, unittest, warnings, and wave.
Relevant report entries
argparsesuggest_on_errorandcolorparameters, changed the 3.15suggest_on_errordefault, removedHelpFormatter(color=...), and added formatter parameters toArgumentParser.format_usage(),format_help(), and_get_formatter()(CPython PR: gh-140448: Defaultsuggest_on_errortoTrueinargparse.ArgumentParsercpython#140450; source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/argparse.py)arraytypecodes for half-precision and complex arrays and widenedarray.typecodes(CPython PRs: Support half-floats in the array module cpython#146238, Add support for numpy buffer formatZfandZdcpython#148675; source: https://github.com/python/cpython/blob/main/Modules/arraymodule.c)ast.dump(color=...)(CPython PR: Add colour toast.dumpoutput cpython#148981; source: https://github.com/python/cpython/blob/main/Lib/ast.py)ast.Import.is_lazyandast.ImportFrom.is_lazyfor lazy imports (CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Parser/Python.asdl)faulthandlermax_threadsparameters (CPython PR: faulthandler: make per-call thread dump cap configurable cpython#149085; source: https://github.com/python/cpython/blob/main/Modules/faulthandler.c)dbm.dumb._Database.reorganize,dbm.sqlite3.REORGANIZE,dbm.sqlite3._Database.reorganize,shelve.ShelveError, andshelveserializer/deserializer keyword-only parameters (CPython PRs: DBM Module Vacuuming cpython#134004, Custom unpickler and pickler for the shelve module cpython#99631; sources: https://github.com/python/cpython/blob/main/Lib/dbm/dumb.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/dbm/sqlite3.py, https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/shelve.py)re.prefixmatchandPattern.prefixmatch(CPython PR: Proposal: re.prefixmatch method (alias for re.match) cpython#86519; source: https://github.com/python/cpython/blob/main/Lib/re/__init__.py)tarfile.TarFile.__init__(mtime=...)(CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/tarfile.py)unittest.TestCase.assertLogs(formatter=...)(CPython PR: Expose log format to users in assertLogs cpython#134567; source: https://github.com/python/cpython/blob/main/Lib/unittest/case.py)warnings.WarningMessage(module=...)and.moduleattribute (CPython source: https://github.com/python/cpython/blob/e81025e6d2e01e38c5a5b656af5739ac9df5ff55/Lib/_py_warnings.py)wave.WAVE_FORMAT_IEEE_FLOAT,getformat,setformat, and 7-field params; removed marker methods for 3.15 (CPython PRs: wave file module does not support 32bit float format cpython#60729, Remove deprecated mark interface forwave.Wave_{read,write}classes cpython#133873; source: https://github.com/python/cpython/blob/main/Lib/wave.py)