mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 16:52:15 +00:00
191 lines
7.3 KiB
HTML
191 lines
7.3 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN"
|
|
"http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
<title>
|
|
The Boost Python Library (Boost.Python)
|
|
</title>
|
|
<h1>
|
|
<img src="../../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277"
|
|
align="center" height="86"><br>The Boost Python Library (Boost.Python)
|
|
</h1>
|
|
|
|
<h2>Synopsis</h2>
|
|
<p>
|
|
Use the Boost Python Library to quickly and easily export a C++ library to <a
|
|
href="http://www.python.org">Python</a> such that the Python interface is
|
|
very similar to the C++ interface. It is designed to be minimally
|
|
intrusive on your C++ design. In most cases, you should not have to alter
|
|
your C++ classes in any way in order to use them with Boost.Python. The system
|
|
<em>should</em> simply ``reflect'' your C++ classes and functions into
|
|
Python.
|
|
|
|
<h2>Supported Platforms</h2>
|
|
<p>Boost.Python is known to have been tested
|
|
against <a href="http://www.python/org/2.2.1">Python 2.2.1</a> using
|
|
the following compilers:
|
|
|
|
<ul>
|
|
<li><a
|
|
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>.
|
|
All tests pass.
|
|
|
|
<li><a
|
|
href="http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5/default.asp">MSVC++6sp5</a>
|
|
with <a href="http://www.stlport.org">STLPort</a>-4.5.3. A compiler bug interferes with
|
|
<a
|
|
href="../example/simple_vector.cpp">libs/python/example/simple_vector.cpp</a>. All
|
|
other tests pass.
|
|
|
|
<p>
|
|
<li><a href="http://msdn.microsoft.com/visualc/">MSVC++7 (Visual
|
|
Studio .NET)</a>. All tests pass.
|
|
|
|
<p>
|
|
<li><a href="http://www.metrowerks.com/products/windows/">Metrowerks
|
|
CodeWarrior Pro7.2 and Pro7.0 for Windows</a>. All tests pass.
|
|
|
|
<p>
|
|
<li><a href="http://gcc.gnu.org">GCC 3.0.4</a> under <a
|
|
href="www.cygwin.com">Cygwin</a> and
|
|
<a href="http://www.redhat.com/">RedHat Linux 7.1</a>.
|
|
All tests pass.
|
|
|
|
<p>
|
|
<li>Compaq C++ V6.2-024 for Digital UNIX (an <a
|
|
href="http://www.edg.com/">EDG</a>-based compiler).
|
|
All tests pass.<br>
|
|
Note that the Boost.Compatibility
|
|
library must be included (see e.g. tru64_cxx.mak in the build
|
|
directory).
|
|
|
|
<p>
|
|
<li>Silicon Graphics MIPSpro Version 7.3.1.2m (an <a
|
|
href="http://www.edg.com/">EDG</a>-based compiler).
|
|
All tests pass.<br>
|
|
Note that the Boost.Compatibility
|
|
library must be included (see e.g. irix_CC.mak in the build
|
|
directory).
|
|
|
|
<p>
|
|
<li><a href="http://gcc.gnu.org">GCC 2.95.2</a> under <a
|
|
href="www.mingw.org">MinGW</a> and <a
|
|
href="http://www.redhat.com/">RedHat Linux 7.1</a>.
|
|
Compilation succeeds, but some tests fail at runtime due to
|
|
exception handling bugs. It is therefore highly recommended
|
|
to use GCC 3.0.4 instead.
|
|
|
|
<p>
|
|
<li><a
|
|
href="http://developer.intel.com/software/products/compilers/c50/">Intel
|
|
C++ 6.0</a> beta: Comprehensive test fails to link due to a
|
|
linker bug. Other tests seem to work.
|
|
|
|
<p>
|
|
<li><a
|
|
href="http://developer.intel.com/software/products/compilers/c50/">Intel
|
|
C++ 5.0</a> Comprehensive test fails at runtime due to an
|
|
exception-handling bug. Other tests seem to work.
|
|
|
|
</ul>
|
|
|
|
<p>
|
|
Note that pickling doesn't work with Python 2.2
|
|
due to a core language bug. This is fixed in
|
|
<a href="http://www.python/org/2.2.1">2.2.1</a>.
|
|
|
|
<p>
|
|
Boost.Python has also been used with other versions of Python back to
|
|
Python 1.5.2. It is expected that the older Python releases still work,
|
|
but we are not regularly testing for backward compatibility.
|
|
|
|
<h2>Credits</h2>
|
|
<ul>
|
|
<li><a href="../../../people/dave_abrahams.htm">David Abrahams</a> originated
|
|
and wrote most of the library, and continues to coordinate development.
|
|
|
|
<li><a href="mailto:koethe@informatik.uni-hamburg.de">Ullrich Koethe</a>
|
|
had independently developed a similar system. When he discovered Boost.Python,
|
|
he generously contributed countless hours of coding and much insight into
|
|
improving it. He is responsible for an early version of the support for <a
|
|
href="overloading.html">function overloading</a> and wrote the support for
|
|
<a href="inheritance.html#implicit_conversion">reflecting C++ inheritance
|
|
relationships</a>. He has helped to improve error-reporting from both
|
|
Python and C++, and has designed an extremely easy-to-use way of
|
|
exposing <a href="special.html#numeric">numeric operators</a>, including
|
|
a way to avoid explicit coercion by means of overloading.
|
|
|
|
<li><a href="http://cci.lbl.gov/staff/ralf_grosse-kunstleve.html">Ralf W.
|
|
Grosse-Kunstleve</a> contributed <a href="pickle.html">pickle support</a>
|
|
and numerous other small improvements. He's working on a way to allow
|
|
types exported by multiple modules to interact.
|
|
|
|
<li>The members of the boost mailing list and the Python community
|
|
supplied invaluable early feedback. In particular, Ron Clarke, Mark Evans,
|
|
Anton Gluck, Chuck Ingold, Prabhu Ramachandran, and Barry Scott took the
|
|
brave step of trying to use Boost.Python while it was still in early
|
|
stages of development.
|
|
|
|
<li>The development of Boost.Python wouldn't have been possible without
|
|
the generous support of <a href="http://www.dragonsys.com/">Dragon
|
|
Systems/Lernout and Hauspie, Inc</a> who supported its development as an
|
|
open-source project.
|
|
</ul>
|
|
|
|
<h2>Table of Contents</h2>
|
|
|
|
<ol>
|
|
<li><a href="extending.html">A Brief Introduction to writing Python
|
|
extension modules</a>
|
|
|
|
<li><a href="comparisons.html">Comparisons between Boost.Python and other
|
|
systems for extending Python</a>
|
|
|
|
<li><a href="example1.html">A Simple Example</a>
|
|
|
|
<li><a href="exporting_classes.html">Exporting Classes</a>
|
|
|
|
<li><a href="overriding.html">Overridable Virtual Functions</a>
|
|
|
|
<li><a href="overloading.html">Function Overloading</a>
|
|
|
|
<li><a href="inheritance.html">Inheritance</a>
|
|
|
|
<li><a href="special.html">Special Method and Operator Support</a>
|
|
|
|
<li><a href="under-the-hood.html">A Peek Under the Hood</a>
|
|
|
|
<li><a href="building.html">Building an Extension Module</a>
|
|
|
|
<li><a href="pickle.html">Pickle Support</a>
|
|
|
|
<li><a href="cross_module.html">Cross-Extension-Module Dependencies</a>
|
|
|
|
<li><a href="enums.html">Wrapping Enums</a>
|
|
|
|
<li><a href="pointers.html">Pointers and Smart Pointers</a>
|
|
|
|
<li><a href="data_structures.txt">Internal Data Structures</a>
|
|
|
|
</ol>
|
|
|
|
<p>
|
|
Documentation is a major ongoing project; assistance is greatly
|
|
appreciated! In the meantime, useful examples of every Boost.Python feature should
|
|
be evident in the regression test files <code>test/comprehensive.[<a
|
|
href="../test/comprehensive.py">py</a>/<a
|
|
href="../test/comprehensive.hpp">hpp</a>/<a
|
|
href="../test/comprehensive.cpp">cpp</a>]</code>
|
|
|
|
<p>
|
|
Questions should be directed to the <a href=
|
|
"http://www.python.org/sigs/c++-sig/">Python C++ SIG</a>.
|
|
|
|
<p>
|
|
© Copyright David Abrahams 2001. Permission to copy, use, modify,
|
|
sell and distribute this document is granted provided this copyright
|
|
notice appears in all copies. This document is provided ``as is'' without
|
|
express or implied warranty, and with no claim as to its suitability for
|
|
any purpose.
|
|
<p>
|
|
Updated: Apr 2002
|
|
|