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.

From Stefan Behnel <stefan_ml@behnel.de>
Subject Re: Providing a Python wrapper to a C++ type.
Date 2012-10-16 14:16 +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>
Newsgroups comp.lang.python
Message-ID <mailman.2268.1350389790.27098.python-list@python.org> (permalink)

Show all headers | 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