Skip to content

Python 3.15: sort allowlists, more small updates#15714

Open
JelleZijlstra wants to merge 37 commits into
python:mainfrom
JelleZijlstra:python315
Open

Python 3.15: sort allowlists, more small updates#15714
JelleZijlstra wants to merge 37 commits into
python:mainfrom
JelleZijlstra:python315

Conversation

@JelleZijlstra
Copy link
Copy Markdown
Member

@JelleZijlstra JelleZijlstra commented May 8, 2026

Part of #15709.

I pointed Codex at the What's New for 3.15 and told it to apply every change relevant to typeshed, then told it to get stubtest running on 3.15 (which found python/cpython#149504) and fix the remaining issues. I also reviewed manually and made a few adjustments (including noticing python/cpython#149534).

Most of the changes were split into smaller PRs; this one now is allowlist sorting plus a few smaller things that were missed. There's a few more allowlist entries that look fixable, but I'll save that for later PRs.

# Conflicts:
#	stdlib/_interpqueues.pyi
#	stdlib/ast.pyi
#	stdlib/base64.pyi
#	stdlib/collections/__init__.pyi
#	stdlib/glob.pyi
#	stdlib/importlib/metadata/__init__.pyi
#	stdlib/pyexpat/__init__.pyi
#	stdlib/sys/__init__.pyi
#	stdlib/threading.pyi
#	stdlib/types.pyi
#	stdlib/typing.pyi
#	stdlib/unicodedata.pyi
#	stdlib/unittest/_log.pyi
#	stdlib/unittest/case.pyi
#	stdlib/wave.pyi
#	stdlib/zipimport.pyi
@github-actions

This comment has been minimized.

@srittau
Copy link
Copy Markdown
Collaborator

srittau commented May 8, 2026

I would like to get the testing infrastructure for 3.15 up before adding 3.15 branches. It also doesn't fill me with confidence that we already have stubtest errors without even testing 3.15.

@srittau
Copy link
Copy Markdown
Collaborator

srittau commented May 8, 2026

Here's my suggestion on how to move forward:

  1. Get the testing infrastructure in place. We'll need to add many stubtest allow entries as a "to do list" to the 3.15 allow lists. (Like we had in the past.)
  2. Split this PR into multiple PRs with a size that's easily reviewable.
  3. Fix remaining issues per PR, but move "harder" fixes to separate PRs if necessary.
  4. Review each PR manually for plausibility and style. When looking at the existing PR, it's clear to me that on the one hand the LLM managed to do a lot of the "grunt work" and provide a good baseline, but on the other hand delivered results that are not suitable for unsupervised inclusion in typeshed.

Copy link
Copy Markdown
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

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

Thanks a lot for this work! I agree with @srittau that it is rather hard to review 1600+ lines of changes accross different modules :(

Comment thread stdlib/collections/__init__.pyi Outdated
Comment thread stdlib/sys/__init__.pyi Outdated
@mbyrnepr2
Copy link
Copy Markdown

Hi! There's one new addition in 3.15 which I notice is missing from the release notes and the current PR:
python/cpython#140951
https://docs.python.org/3.15/library/wave.html#wave.open.

I guess if the What's New is up to date there shouldn't be a problem for the AI but maybe there are other changes also missing?

@JelleZijlstra
Copy link
Copy Markdown
Member Author

wave.open: Yes, I had it look only at the What's New. I think we're liable to miss such changes to only allowed parameter types, because there's no automatic way to check them; I wouldn't be surprised if we similarly missed some changes for earlier versions. Maybe I'll try making an AI look at the whole diff between 3.14 and 3.15 and flag things that were missed.

Point taken on getting CI set up first, I'll do that.

The stubtest failures seem to be mostly from changes that were made unconditionally that should have been made conditional on version.

@JelleZijlstra JelleZijlstra marked this pull request as draft May 8, 2026 16:11
@JelleZijlstra
Copy link
Copy Markdown
Member Author

My plan now:

  • Add 3.15 CI (Add Python 3.15 test infrastructure #15718)
  • Make Codex fix all CI issues on this PR to have a clean slate (in progress)
  • Extract separate PRs for smaller changes (probably <5 modules at a time); start them as draft and request review when I feel they're ready.

@srittau
Copy link
Copy Markdown
Collaborator

srittau commented May 8, 2026

Extract separate PRs for smaller changes (probably <5 modules at a time); start them as draft and request review when I feel they're ready.

I'll try to prioritize reviewing. If it's just small, straight-forward changes, I'm fine with larger PRs. It's more about the amount if lines and the complexity than the amount of modules.

Comment thread stdlib/profiling/sampling.pyi Outdated
@github-actions

This comment has been minimized.

# Conflicts:
#	stdlib/@tests/stubtest_allowlists/darwin-py315.txt
#	stdlib/@tests/stubtest_allowlists/linux-py315.txt
#	stdlib/@tests/stubtest_allowlists/py315.txt
#	stdlib/@tests/stubtest_allowlists/win32-py315.txt
#	stdlib/_collections_abc.pyi
#	stdlib/_socket.pyi
#	stdlib/_ssl.pyi
#	stdlib/binascii.pyi
#	stdlib/builtins.pyi
#	stdlib/calendar.pyi
#	stdlib/collections/__init__.pyi
#	stdlib/datetime.pyi
#	stdlib/difflib.pyi
#	stdlib/hashlib.pyi
#	stdlib/mmap.pyi
#	stdlib/platform.pyi
#	stdlib/re.pyi
#	stdlib/resource.pyi
#	stdlib/socket.pyi
#	stdlib/sqlite3/__init__.pyi
#	stdlib/typing.pyi
#	stdlib/unittest/_log.pyi
#	stdlib/wave.pyi
Comment thread stdlib/collections/__init__.pyi Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

# Conflicts:
#	stdlib/@tests/stubtest_allowlists/py315.txt
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@JelleZijlstra JelleZijlstra changed the title Update stdlib for Python 3.15 Python 3.15: sort allowlists, more small updates May 13, 2026
@JelleZijlstra
Copy link
Copy Markdown
Member Author

With lots of other PRs merged, this is now mostly allowlist sorting.

@JelleZijlstra JelleZijlstra marked this pull request as ready for review May 13, 2026 03:32
@github-actions
Copy link
Copy Markdown
Contributor

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

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.

4 participants