Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81862 > unrolled thread
| Started by | Joshua Landau <joshua@landau.ws> |
|---|---|
| First post | 2014-12-03 13:35 +0000 |
| Last post | 2014-12-03 13:35 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Python, C++ interaction Joshua Landau <joshua@landau.ws> - 2014-12-03 13:35 +0000
| From | Joshua Landau <joshua@landau.ws> |
|---|---|
| Date | 2014-12-03 13:35 +0000 |
| Subject | Re: Python, C++ interaction |
| Message-ID | <mailman.16536.1417613781.18130.python-list@python.org> |
On 3 December 2014 at 08:29, Michael Kreim <michael@perfect-kreim.de> wrote: > > What are you using to wrap C++ classes for Python? > Can you recommend swig? Should I give it another try? > Did I misunderstood ctypes? The PyPy guys would love it if you used CFFI. Cython is also a wonderful approach. There's a lot of support of Cython, but it's also possible to find comparisons in CFFI's favour: http://eev.ee/blog/2013/09/13/cython-versus-cffi/ I've not actually used CFFI, but I've heard good things about it. > Also later on in our code development we would like to pass python lambda > functions to C++. So far I understood that this seems not to be possible. Do > you have any ideas or hints on this topics? This is definitely possible. You'll need to build C++ against CPython and use the Python C API. I've personally found that Boost::Python simplified this dramatically and IMHO if most of your code needs to use Python types directly from C++ I'd scrap Cython altogether and just use Boost. Here's some stuff on callbacks with CFFI: https://cffi.readthedocs.org/en/release-0.5/#callbacks
Back to top | Article view | comp.lang.python
csiph-web