Python bindings HOWTO proof reader request

Ben McGinnes ben at
Fri Mar 23 23:18:02 CET 2018

On Wed, Mar 21, 2018 at 10:57:14AM +0100, Justus Winter wrote:
> Tobias Mueller <muelli at> writes:
> > On Tue, 2018-03-20 at 10:26 +1100, Ben McGinnes wrote:
> >> That is my long term plan: to (ideally) port the damned thing off SWIG
> >> entirely and to CFFI.
> > hrm.
> > The benefit of SWIG is that it nicely exposes everything the native
> > build does.  So it's more work to not expose an existing gpgme feature
> > than it is to implement it in the python bindings.
> > Does CFFI also provide that kind of automatic exposure?
> Yes.  You feed it a header file and get an object with a method for
> every function found in the header.

Yes, but only if that header file does not contain features which are
not yet supported by the underlying C parser, which I think gpgme.h
currently does.

> What it does *not* provide is automatic translation of values at the
> ffi boundary.  I consider that a rather cool feature of SWIG.

It is, but I suspect that that's part of the things which stem from
SWIG being its own little intermediate language between C and Python,
just like Cython is.  Whereas with CFFI you just need to know Python
and a bit of C.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <>

More information about the Gnupg-devel mailing list