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


Groups > comp.lang.python > #31393

Re: Providing a Python wrapper to a C++ type.

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.000
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python.': 0.02; 'python,': 0.02; 'subject:Python': 0.05; 'case.': 0.05; 'c++,': 0.07; 'python': 0.09; 'normally,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runtime': 0.09; '(but': 0.15; 'properly': 0.15; 'caveat': 0.16; 'distinction': 0.16; 'from:addr:behnel.de': 0.16; 'from:addr:stefan_ml': 0.16; 'from:name:stefan behnel': 0.16; 'fuzzy': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'certainly': 0.17; 'stefan': 0.17; 'code.': 0.20; 'embedding': 0.22; 'idea': 0.24; 'header:In- Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'c++': 0.27; 'header:X-Complaints-To:1': 0.28; 'actual': 0.28; 'embed': 0.29; 'yes.': 0.29; 'case,': 0.29; 'worked': 0.30; 'e.g.': 0.30; 'initially': 0.30; 'code': 0.31; 'running': 0.32; 'asked': 0.33; 'docs': 0.33; 'to:addr:python-list': 0.33; '(with': 0.33; 'there': 0.35; 'received:org': 0.36; 'really': 0.36; 'but': 0.36; 'quite': 0.37; 'subject:: ': 0.38; 'sure': 0.38; 'performance': 0.39; 'to:addr:python.org': 0.39; 'application': 0.40; 'header:Received:5': 0.40; 'your': 0.60; 'most': 0.61; 'kind': 0.61; 'needing': 0.62; 'between': 0.63; 'differences': 0.65; 'difference.': 0.84; 'interaction.': 0.84; 'irrelevant': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Stefan Behnel <stefan_ml@behnel.de>
Subject Re: Providing a Python wrapper to a C++ type.
Date Tue, 16 Oct 2012 14:16:10 +0200
References <b71bb1ac-cfe0-45eb-a384-4d6109c99543@googlegroups.com> <0423426c-c19a-4634-9f67-5bf92d766f61@googlegroups.com> <mailman.2263.1350387583.27098.python-list@python.org> <d2c77c2a-21de-4f39-8c10-d1b44fdf23d7@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host fw-snc-frn5-de01.fw.telefonica.de
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120912 Thunderbird/15.0.1
In-Reply-To <d2c77c2a-21de-4f39-8c10-d1b44fdf23d7@googlegroups.com>
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 <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2268.1350389790.27098.python-list@python.org> (permalink)
Lines 27
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1350389790 news.xs4all.nl 6948 [2001:888:2000:d::a6]:55396
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:31393

Show key headers only | View raw


Marco Nawijn, 16.10.2012 13:46:
> I never worked with Cython (but I know it is very powerful and
> interesting) but in my mind there are slight differences in usage
> scenario between e.g. Boost Python and Cython. For me the idea of Cython
> is that your main code is in Python

Normally, yes. You can embed Cython code in C++ just like any other C code
(with the caveat of needing to make sure the Python runtime is properly set
up), but that certainly isn't the most popular use case.


> but you want to improve the
> performance of specific parts of the code. In that case, Cython is the
> way to go. In case of Boost Python, the scenario for me is that you have
> a main program/library in C++, but you want to be able use the
> functionality from Python.

That's really just a slight difference. What kind of code initially started
up an application is quite irrelevant once it has been running for a while.
The distinction between embedding and extending, as the Python docs put it,
is actually quite fuzzy when it comes to the actual code interaction.

Note also that this isn't the use case here, the OP asked for wrapping a
C++ type for use in Python.

Stefan

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


Thread

Providing a Python wrapper to a C++ type. aaron.l.france@gmail.com - 2012-10-16 01:11 -0700
  Re: Providing a Python wrapper to a C++ type. Marco Nawijn <nawijn@gmail.com> - 2012-10-16 03:17 -0700
    Re: Providing a Python wrapper to a C++ type. Stefan Behnel <stefan_ml@behnel.de> - 2012-10-16 13:39 +0200
      Re: Providing a Python wrapper to a C++ type. Marco Nawijn <nawijn@gmail.com> - 2012-10-16 04:46 -0700
        Re: Providing a Python wrapper to a C++ type. Stefan Behnel <stefan_ml@behnel.de> - 2012-10-16 14:16 +0200
        Re: Re: Providing a Python wrapper to a C++ type. Evan Driscoll <driscoll@cs.wisc.edu> - 2012-10-16 11:42 -0500
          Re: Providing a Python wrapper to a C++ type. Christian Gollwitzer <auriocus@gmx.de> - 2012-10-16 21:03 +0200
      Re: Providing a Python wrapper to a C++ type. Marco Nawijn <nawijn@gmail.com> - 2012-10-16 04:46 -0700

csiph-web