Skip to content

Fix stdlib stubtest on Python 3.14.9 and 3.15.1 - #16596

Merged
hauntsaninja merged 1 commit into
mainfrom
alex/fix-stdlib-stubtest-314-315
Oct 22, 2026
Merged

hauntsaninja merged 1 commit into
mainfrom
alex/fix-stdlib-stubtest-314-315

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Fixes #16595.

Update the stubs for contains_token_type on email._header_value_parser.TokenList and Terminal and the optional context argument to multiprocessing.context.DefaultContext, both introduced in Python 3.14.9 and 3.15.1, and for _remote_debugging.BinaryWriter.limit_reached, introduced in Python 3.15.1.

The contains_token_type stubs accept None because TokenList.token_type defaults to None and TokenList.contains_token_type checks that value against its arguments; for example, TokenList().contains_token_type(None) returns True. Terminal.contains_token_type accepts None as well because TokenList.contains_token_type(None) can forward the argument to Terminal children.

Related CPython PRs:

@github-actions

Copy link
Copy Markdown
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

sphinx (https://github.com/sphinx-doc/sphinx)
- sphinx/builders/_epub_base.py:34:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

scipy-stubs (https://github.com/scipy/scipy-stubs)
+ tests/misc/test_submodules_empty.pyi:3: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
@AlexWaygood
AlexWaygood marked this pull request as ready for review October 22, 2026 01:14
@hauntsaninja
hauntsaninja merged commit 7030b26 into main Oct 22, 2026
88 checks passed
@hauntsaninja
hauntsaninja deleted the alex/fix-stdlib-stubtest-314-315 branch October 22, 2026 02:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants