Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #81862
| Path | csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <joshua.landau.ws@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.015 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'api.': 0.05; 'cpython': 0.05; 'subject:Python': 0.06; 'pypy': 0.07; 'url:blog': 0.10; 'python': 0.11; 'boost.': 0.16; 'c++.': 0.16; 'lambda': 0.16; 'simplified': 0.16; 'try?': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'later': 0.20; 'seems': 0.21; 'python?': 0.22; 'guys': 0.24; "i've": 0.25; 'pass': 0.26; 'header:In-Reply-To:1': 0.27; 'michael': 0.29; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'stuff': 0.32; 'another': 0.32; 'to:name:python-list': 0.33; "i'd": 0.34; 'classes': 0.35; 'december': 0.35; 'possible.': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'c++': 0.36; 'possible': 0.36; 'url:org': 0.36; 'should': 0.36; 'to:addr:python-list': 0.38; 'heard': 0.39; 'to:addr:python.org': 0.39; 'wonderful': 0.60; 'most': 0.60; 'url:5': 0.61; "you'll": 0.62; 'our': 0.64; 'love': 0.65; 'hints': 0.68; 'dramatically': 0.84; 'url:2013': 0.84; 'approach.': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=Oa7vwAVGgRWAjPdXT4j8aJK+Erjk9WgaV5bB8QemiZc=; b=iLQdzWSxOa3HM/KhKltc2AQTkbBmMrmj3NW6j6LllTYiSRoQQrH33kdRUgOgX0bklB T9NXiAcGJszjdGDkUIWJt/Z7XxePAVmsgnrp6UeteD283Fl0sdAlNCkYo24xf5s/n713 ZlXPphhWeuf969JVfkUMUptYbazoiHHLS4THdqWnpRtTOgLI+nWdX8oibZkxP6UJRmpY /u4s1V4Z/SZ5moM9qtuEcW3u0Y9HUy1WMuK8Wr0LW5G8ek42Ld1aMxhdwGf2j7evgxqx c6eHqqom7Xjs1JPCQjAWp7LRUzPXJ/7rAqFsTydvk+HU6aFM/jZMAe2MqMya2wvcEbXZ 1KcQ== |
| X-Received | by 10.152.37.201 with SMTP id a9mr4297498lak.53.1417613779975; Wed, 03 Dec 2014 05:36:19 -0800 (PST) |
| MIME-Version | 1.0 |
| Sender | joshua.landau.ws@gmail.com |
| In-Reply-To | <547EC9E2.8070502@perfect-kreim.de> |
| References | <547EC9E2.8070502@perfect-kreim.de> |
| From | Joshua Landau <joshua@landau.ws> |
| Date | Wed, 3 Dec 2014 13:35:39 +0000 |
| X-Google-Sender-Auth | 1E07ti_e3ZgPxXHIw0lPrAapRyQ |
| Subject | Re: Python, C++ interaction |
| To | python-list <python-list@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.16536.1417613781.18130.python-list@python.org> (permalink) |
| Lines | 25 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1417613781 news.xs4all.nl 2977 [2001:888:2000:d::a6]:35154 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:81862 |
Show key headers only | View raw
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 comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Python, C++ interaction Joshua Landau <joshua@landau.ws> - 2014-12-03 13:35 +0000
csiph-web