[pypy-commit] cffi default: Add a small warning

arigo noreply at buildbot.pypy.org
Tue May 19 20:18:34 CEST 2015


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r2057:f5399d831d30
Date: 2015-05-19 20:18 +0200
http://bitbucket.org/cffi/cffi/changeset/f5399d831d30/

Log:	Add a small warning

diff --git a/doc/source/cdef.rst b/doc/source/cdef.rst
--- a/doc/source/cdef.rst
+++ b/doc/source/cdef.rst
@@ -109,8 +109,8 @@
 
 Note that CFFI actually contains two different ``FFI`` classes.  The
 page `Using the ffi/lib objects`_ describes the common functionality.
-This minimum is what you get in the ``from package._foo import ffi``
-lines above.  The extended ``FFI`` class is the one you get from
+It is what you get in the ``from package._foo import ffi`` lines above.
+On the other hand, the extended ``FFI`` class is the one you get from
 ``import cffi; ffi = cffi.FFI()``.  It has the same functionality (for
 in-line use), but also the extra methods described below (to prepare
 the FFI).
@@ -125,6 +125,13 @@
 split into a different PyPI package that only installs
 ``_cffi_backend``.)
 
+Note that a few small differences do exist: notably, ``from _foo import
+ffi`` returns an object of a type written in C, which does not let you
+add random attributes to it (nor does it have all the
+underscore-prefixed internal attributes of the Python version).
+Similarly, the ``lib`` objects returned by the C version are read-only,
+apart from writes to global variables.
+
 
 ffi.cdef(): declaring types and functions
 -----------------------------------------


More information about the pypy-commit mailing list