[pypy-commit] cffi default: Update docs
arigo
pypy.commits at gmail.com
Sat Aug 6 15:02:43 EDT 2016
Author: Armin Rigo <arigo at tunes.org>
Branch:
Changeset: r2734:afc6e9c21056
Date: 2016-08-06 21:05 +0200
http://bitbucket.org/cffi/cffi/changeset/afc6e9c21056/
Log: Update docs
diff --git a/doc/source/cdef.rst b/doc/source/cdef.rst
--- a/doc/source/cdef.rst
+++ b/doc/source/cdef.rst
@@ -837,8 +837,8 @@
.. __: distutils-setuptools_
The following example should work both with old (pre-1.0) and new
-versions of CFFI---supporting both is important to run on PyPy,
-because CFFI 1.0 does not work in PyPy < 2.6:
+versions of CFFI---supporting both is important to run on old
+versions of PyPy (CFFI 1.0 does not work in PyPy < 2.6):
.. code-block:: python
diff --git a/doc/source/ref.rst b/doc/source/ref.rst
--- a/doc/source/ref.rst
+++ b/doc/source/ref.rst
@@ -627,12 +627,12 @@
*`` argument might be passed as ``[[x, y]]`` or ``[{'x': 5, 'y':
10}]``.
- As an optimization, the CPython version of CFFI assumes that a
+ As an optimization, CFFI assumes that a
function with a ``char *`` argument to which you pass a Python
string will not actually modify the array of characters passed in,
and so passes directly a pointer inside the Python string object.
- (PyPy might in the future do the same, but it is harder because
- strings are not naturally zero-terminated in PyPy.)
+ (On PyPy, this optimization is only available since PyPy 5.4
+ with CFFI 1.8.)
`(**)` C function calls are done with the GIL released.
diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst
--- a/doc/source/whatsnew.rst
+++ b/doc/source/whatsnew.rst
@@ -7,7 +7,14 @@
====
* Removed the restriction that ``ffi.from_buffer()`` cannot be used on
- byte strings (PyPy was improved and can now support that case).
+ byte strings. Now you can get a ``char *`` out of a byte string,
+ which is valid as long as the string object is kept alive. (But
+ don't use it to *modify* the string object! If you need this, use
+ ``bytearray`` or other official techniques.)
+
+* PyPy 5.4 can now pass a byte string directly to a ``char *``
+ argument (in older versions, a copy would be made). This used to be
+ a CPython-only optimization.
v1.7
More information about the pypy-commit
mailing list