gh-118830: Bump pickle.DEFAULT_PROTOCOL to 5 (GH-119340)

This commit is contained in:
Rodrigo Oliveira 2024-07-19 14:47:10 +00:00 committed by GitHub
parent a1df1b4439
commit d66b06107b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 33 additions and 20 deletions

View file

@ -156,13 +156,14 @@ to read the pickle produced.
* Protocol version 4 was added in Python 3.4. It adds support for very large
objects, pickling more kinds of objects, and some data format
optimizations. It is the default protocol starting with Python 3.8.
optimizations. This was the default protocol in Python 3.8--3.13.
Refer to :pep:`3154` for information about improvements brought by
protocol 4.
* Protocol version 5 was added in Python 3.8. It adds support for out-of-band
data and speedup for in-band data. Refer to :pep:`574` for information about
improvements brought by protocol 5.
data and speedup for in-band data. It is the default protocol starting with
Python 3.14. Refer to :pep:`574` for information about improvements brought
by protocol 5.
.. note::
Serialization is a more primitive notion than persistence; although
@ -199,8 +200,10 @@ The :mod:`pickle` module provides the following constants:
An integer, the default :ref:`protocol version <pickle-protocols>` used
for pickling. May be less than :data:`HIGHEST_PROTOCOL`. Currently the
default protocol is 4, first introduced in Python 3.4 and incompatible
with previous versions.
default protocol is 5, introduced in Python 3.8 and incompatible
with previous versions. This version introduces support for out-of-band
buffers, where :pep:`3118`-compatible data can be transmitted separately
from the main pickle stream.
.. versionchanged:: 3.0
@ -210,6 +213,10 @@ The :mod:`pickle` module provides the following constants:
The default protocol is 4.
.. versionchanged:: 3.14
The default protocol is 5.
The :mod:`pickle` module provides the following functions to make the pickling
process more convenient: