Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91015

Strategies for using cffi with C++ code?

Date 2015-05-21 11:41 -0500
Subject Strategies for using cffi with C++ code?
From Skip Montanaro <skip.montanaro@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.203.1432226500.17265.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

If my reading so far is correct, you can't directly apply cffi to C++
libraries. Everything has to be wrapped in "extern C" declarations, which
means, practically speaking, that you have to provide factory function
wrapper(s) around constructors and methods. I did find a trivial example:

https://gist.github.com/tonyseek/7821993

but that just exposes a simple function to the Python programmer. Does
someone have a pointer to more substantive example of exposing a C++ class
to Python?

Thanks,

Skip

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Strategies for using cffi with C++ code? Skip Montanaro <skip.montanaro@gmail.com> - 2015-05-21 11:41 -0500

csiph-web