Skip to content

Fix value of pickle.DEFAULT_PROTOCOL for Python <3.14#15446

Merged
srittau merged 1 commit intopython:mainfrom
brianschubert:stdlib-pickle-defaultprotocol
Feb 21, 2026
Merged

Fix value of pickle.DEFAULT_PROTOCOL for Python <3.14#15446
srittau merged 1 commit intopython:mainfrom
brianschubert:stdlib-pickle-defaultprotocol

Conversation

@brianschubert
Copy link
Collaborator

A fixed Final value was added in #14577, but the runtime value varies between versions.

For reference:

$ uv run --python 3.14 python3 -c 'import pickle; print(pickle.DEFAULT_PROTOCOL)'
5
$ uv run --python 3.13 python3 -c 'import pickle; print(pickle.DEFAULT_PROTOCOL)'
4

docs: https://docs.python.org/3/library/pickle.html#pickle.DEFAULT_PROTOCOL
source: https://github.com/python/cpython/blame/main/Lib/pickle.py#L69

@github-actions
Copy link
Contributor

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

@srittau srittau merged commit a3d6947 into python:main Feb 21, 2026
51 checks passed
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