@@ -20,10 +20,12 @@ class _pickle.UnpicklerMemoProxy "UnpicklerMemoProxyObject *" "&UnpicklerMemoPro
2020[clinic start generated code]*/
2121/*[clinic end generated code: output=da39a3ee5e6b4b0d input=4b3e113468a58e6c]*/
2222
23- /* Bump this when new opcodes are added to the pickle protocol. */
23+ /* Bump HIGHEST_PROTOCOL when new opcodes are added to the pickle protocol.
24+ Bump DEFAULT_PROTOCOL only when the oldest still supported version of Python
25+ already includes it. */
2426enum {
2527 HIGHEST_PROTOCOL = 4 ,
26- DEFAULT_PROTOCOL = 3
28+ DEFAULT_PROTOCOL = 4
2729};
2830
2931/* Pickle opcodes. These must be kept updated with pickle.py.
@@ -7176,8 +7178,9 @@ This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may
71767178be more efficient.
71777179
71787180The optional *protocol* argument tells the pickler to use the given
7179- protocol supported protocols are 0, 1, 2, 3 and 4. The default
7180- protocol is 3; a backward-incompatible protocol designed for Python 3.
7181+ protocol; supported protocols are 0, 1, 2, 3 and 4. The default
7182+ protocol is 4. It was introduced in Python 3.4, it is incompatible
7183+ with previous versions.
71817184
71827185Specifying a negative protocol version selects the highest protocol
71837186version supported. The higher the protocol used, the more recent the
@@ -7196,7 +7199,7 @@ to map the new Python 3 names to the old module names used in Python
71967199static PyObject *
71977200_pickle_dump_impl (PyObject * module , PyObject * obj , PyObject * file ,
71987201 PyObject * protocol , int fix_imports )
7199- /*[clinic end generated code: output=a4774d5fde7d34de input=830f8a64cef6f042 ]*/
7202+ /*[clinic end generated code: output=a4774d5fde7d34de input=93f1408489a87472 ]*/
72007203{
72017204 PicklerObject * pickler = _Pickler_New ();
72027205
@@ -7236,7 +7239,8 @@ Return the pickled representation of the object as a bytes object.
72367239
72377240The optional *protocol* argument tells the pickler to use the given
72387241protocol; supported protocols are 0, 1, 2, 3 and 4. The default
7239- protocol is 3; a backward-incompatible protocol designed for Python 3.
7242+ protocol is 4. It was introduced in Python 3.4, it is incompatible
7243+ with previous versions.
72407244
72417245Specifying a negative protocol version selects the highest protocol
72427246version supported. The higher the protocol used, the more recent the
@@ -7250,7 +7254,7 @@ Python 2, so that the pickle data stream is readable with Python 2.
72507254static PyObject *
72517255_pickle_dumps_impl (PyObject * module , PyObject * obj , PyObject * protocol ,
72527256 int fix_imports )
7253- /*[clinic end generated code: output=d75d5cda456fd261 input=293dbeda181580b7 ]*/
7257+ /*[clinic end generated code: output=d75d5cda456fd261 input=b6efb45a7d19b5ab ]*/
72547258{
72557259 PyObject * result ;
72567260 PicklerObject * pickler = _Pickler_New ();
0 commit comments