PEP 574: minor updates (GH-805)

* Fix example
* Mention Numpy implementation and benchmark
This commit is contained in:
Antoine Pitrou 2018-10-11 13:54:53 +02:00 committed by GitHub
parent 8013370d7c
commit 7808074692
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 6 deletions

View File

@ -316,7 +316,7 @@ Improved in-band performance
Even in-band pickling can be improved by returning a ``PickleBuffer``
instance from ``__reduce_ex__``, as one copy is avoided on the serialization
path [#ogrisel-numpy]_ [#arrow-pickle5-benchmark]_.
path [#arrow-pickle5-benchmark]_ [#numpy-pickle5-benchmark]_.
Caveats
@ -358,7 +358,7 @@ original Numpy object (and, incidentally, keeping it alive)::
>>> a[0]
0.0
>>> buffers = []
>>> data = pickle.dumps(a, protocol=5, buffer_callback=buffers.extend)
>>> data = pickle.dumps(a, protocol=5, buffer_callback=buffers.append)
>>> b = pickle.loads(data, buffers=buffers)
>>> b[0] = 42
>>> a[0]
@ -460,7 +460,10 @@ A first implementation is available in the author's GitHub fork [#pickle5-git]_.
An experimental backport for Python 3.6 and 3.7 is downloadable from PyPI
[#pickle5-pypi]_.
Experimental support for out-of-band buffers was also added to the Apache
Support for pickle protocol 5 and out-of-band buffers was added to Numpy
[#numpy-pickle5-pr]_.
Support for pickle protocol 5 and out-of-band buffers was added to the Apache
Arrow Python bindings [#arrow-pickle5-pr]_.
@ -516,15 +519,18 @@ References
.. [#pickle5-pypi] ``pickle5`` project on PyPI
https://pypi.org/project/pickle5/
.. [#ogrisel-numpy] Draft use of pickle protocol 5 for Numpy array pickling
https://gist.github.com/ogrisel/a2b0e5ae4987a398caa7f9277cb3b90a
.. [#arrow-pickle5-pr] Pull request: Experimental zero-copy pickling in Apache Arrow
https://github.com/apache/arrow/pull/2161
.. [#arrow-pickle5-benchmark] Benchmark zero-copy pickling in Apache Arrow
https://github.com/apache/arrow/pull/2161#issuecomment-407859213
.. [#numpy-pickle5-pr] Pull request: Support pickle protocol 5 in Numpy
https://github.com/numpy/numpy/pull/12011
.. [#numpy-pickle5-benchmark] Benchmark pickling Numpy arrays with different pickle protocols
https://github.com/numpy/numpy/issues/11161#issuecomment-424035962
Copyright
=========