|
| 1 | +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0//EN" |
| 2 | +"http://www.w3.org/TR/REC-html40/strict.dtd"> |
| 3 | + <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> |
| 4 | + <title> |
| 5 | + py_cpp Python/C++ binding documentation |
| 6 | + </title> |
| 7 | + <h1> |
| 8 | + <img src="../../../c++boost.gif" alt="c++boost.gif (8819 bytes)" width="277" |
| 9 | + align="center" height="86"> py_cpp<a href="#naming_contest">*</a> |
| 10 | + </h1> |
| 11 | + |
| 12 | + <p> |
| 13 | + The source code for py_cpp, including a MSVC demo project is available <a |
| 14 | + href="py_cpp_20001106.zip">here</a>. |
| 15 | + |
| 16 | +<h2>Synopsis</h2> |
| 17 | + <p> |
| 18 | + py_cpp is a system for quickly and easily interfacing C++ code with <a |
| 19 | + href="http:www.python.org">Python</a> such that the Python interface is |
| 20 | + very similar to the C++ interface. It is designed to be minimally |
| 21 | + intrusive on your C++ design. In most cases, you should not have to alter |
| 22 | + your C++ classes in any way in order to use them with py_cpp. The system |
| 23 | + <em>should</em> simply “reflect” your C++ classes and functions into |
| 24 | + Python. The major features of py_cpp include support for: |
| 25 | +<ul> |
| 26 | +<li><a href="inheritance.hml">Subclassing extension types in Python</a> |
| 27 | +<li><a href="overriding.html">Overriding virtual functions in Python</a> |
| 28 | +<li><a href="overloading.html">[Member] function Overloading</a> |
| 29 | +<li><a href="special.html#numeric_auto">Automatic wrapping of numeric operators</a> |
| 30 | +</ul> |
| 31 | +among others. |
| 32 | + |
| 33 | + |
| 34 | +<h2>Supported Platforms</h2> |
| 35 | +<p>py_cpp has been tested in the following configurations: |
| 36 | + |
| 37 | +<ul> |
| 38 | +<li>Against Python 1.5.2 using the following compiler/library: |
| 39 | + |
| 40 | + <ul> |
| 41 | + <li><a |
| 42 | + href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a> |
| 43 | + |
| 44 | + <li><a |
| 45 | + href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a>/<a |
| 46 | + href="http://www.stlport.org">STLport 4.0</a> |
| 47 | + |
| 48 | + <li><a href="http://gcc.gnu.org/">GCC 2.95.2</a> [by <a href="mailto: [email protected]">Ullrich |
| 49 | + Koethe</a>] |
| 50 | + |
| 51 | + <li><a href="http://gcc.gnu.org/">GCC 2.95.2</a>/<a href="http://www.stlport.org">STLport 4.0</a> |
| 52 | + |
| 53 | + <li>Compaq C++ V6.2-024 for Digital UNIX V5.0 Rev. 910 (an <a |
| 54 | + href="http://www.edg.com/">EDG</a>-based compiler) with <a |
| 55 | + href="http://www.stlport.org/beta.html">STLport-4.1b3</a> [by <a |
| 56 | + href="mailto: [email protected]">Ralf W. Grosse-Kunstleve</a>] |
| 57 | + |
| 58 | + <li>An upcoming release of <a href="http://www.metrowerks.com/products/windows/">Metrowerks CodeWarrior |
| 59 | + Pro6 for Windows</a> (the first release has a bug that's fatal to py_cpp) |
| 60 | + </ul> |
| 61 | +<br> |
| 62 | +<li>Against Python 2.0 using the following compiler/library combinations: |
| 63 | +<ul> |
| 64 | + <li><a |
| 65 | + href="http://msdn.microsoft.com/vstudio/sp/vs6sp4/dnldoverview.asp">MSVC++6sp4</a> [by |
| 66 | + <a href="mailto: [email protected]">Alex Martelli</a>] |
| 67 | +</ul> |
| 68 | +</ul> |
| 69 | + |
| 70 | +<p>Py_cpp requires the <a href="http://www.boost.org">boost</a> libraries, and is |
| 71 | + has been accepted for inclusion into the boost libraries pending “boostification“ |
| 72 | + (completion of the documentation, change in some naming conventions and |
| 73 | + resolution of some namespace issues). |
| 74 | + |
| 75 | +<h2>Credits</h2> |
| 76 | +<ul> |
| 77 | + <li><a href="mailto: [email protected]">David Abrahams</a> originated |
| 78 | + and wrote py_cpp. |
| 79 | + |
| 80 | + <li><a href="mailto: [email protected]">Ullrich Koethe</a> |
| 81 | + had independently developed a similar system. When he discovered py_cpp, |
| 82 | + he generously contributed countless hours of coding and much insight into |
| 83 | + improving it. He is responsible for an early version of the support for <a |
| 84 | + href="overloading.html">function overloading</a> and wrote the support for |
| 85 | + <a href="inheritance.html#implicit_conversion">reflecting C++ inheritance |
| 86 | + relationships</a>. He has helped to improve error-reporting from both |
| 87 | + Python and C++, and has designed an extremely easy-to-use way of |
| 88 | + exposing <a href="special.html#numeric">numeric operators</a>, including |
| 89 | + a way to avoid explicit coercion by means of overloading. |
| 90 | + |
| 91 | + <li>The members of the boost mailing list and the Python community supplied |
| 92 | + invaluable early feedback. In particular, Ron Clarke, Mark Evans, Anton |
| 93 | + Gluck, Ralf W. Grosse-Kunstleve, Prabhu Ramachandran, and Barry Scott took |
| 94 | + the brave step of trying to use py_cpp while it was still in early stages |
| 95 | + of development. |
| 96 | + |
| 97 | + <li>The development of py_cpp wouldn't have been |
| 98 | + possible without the generous support of <a href="http://www.dragonsys.com/">Dragon Systems/Lernout and |
| 99 | + Hauspie, Inc</a> who supported its development as an open-source project. |
| 100 | +</ul> |
| 101 | + |
| 102 | + <h2>Table of Contents</h2> |
| 103 | + |
| 104 | + <ol> |
| 105 | + <li><a href="extending.html">A Brief Introduction to writing Python |
| 106 | + extension modules</a> |
| 107 | + |
| 108 | + <li><a href="comparisons.html">Comparisons between py_cpp and other |
| 109 | + systems for extending Python</a> |
| 110 | + |
| 111 | + <li><a href="example1.html">A Simple Example Using py_cpp</a> |
| 112 | + |
| 113 | + <li><a href="overriding.html">Overridable Virtual Functions</a> |
| 114 | + |
| 115 | + <li><a href="overloading.html">Function Overloading</a> |
| 116 | + |
| 117 | + <li><a href="inheritance.html">Inheritance</a> |
| 118 | + |
| 119 | + <li><a href="special.html">Special Method and Operator Support</a> |
| 120 | + |
| 121 | + <li><a href="under-the-hood.html">A Peek Under the Hood</a> |
| 122 | + |
| 123 | + <li><a href="building.html">Building a Module with Py_cpp</a> |
| 124 | + |
| 125 | + <li>Advanced Topics |
| 126 | + |
| 127 | + <ol> |
| 128 | + <li>class_builder<> |
| 129 | + |
| 130 | + <li><a href="enums.html">enums</a> |
| 131 | + |
| 132 | + <li>References |
| 133 | + |
| 134 | + <li><a href="pointers.html">Pointers and Smart Pointers</a> |
| 135 | + |
| 136 | + <li>Built-in Python Types |
| 137 | + |
| 138 | + <li>Other Extension Types |
| 139 | + |
| 140 | + <li>Templates |
| 141 | + </ol> |
| 142 | + |
| 143 | +</ol> |
| 144 | + |
| 145 | + <p> |
| 146 | + More sophisticated examples are given in |
| 147 | + <code>extclass_demo.cpp</code>, <code> extclass_demo.h</code>, and <code> |
| 148 | + test_extclass.py</code> in the <a href="py_cpp.tgz">source code |
| 149 | + archive</a>. There's much more here, and much more documentation to |
| 150 | + come... |
| 151 | + <p> |
| 152 | + Questions should be directed to <a href= |
| 153 | + "http://www.egroups.com/list/boost">the boost mailing list</a>. |
| 154 | + |
| 155 | + <h2>Naming Contest</h2> |
| 156 | + |
| 157 | + <p> |
| 158 | + Yes, I know py_cpp is a lousy name. Problem is, the best names my puny |
| 159 | + imagination can muster (IDLE and GRAIL) are taken, so I'm holding a |
| 160 | + naming contest. First prize? You get to pick the name<0.2wink> and |
| 161 | + you will be credited in the documentation. Names that have been suggested |
| 162 | + so far include: |
| 163 | + <ul> |
| 164 | + <li> |
| 165 | + Py++ |
| 166 | + <li> |
| 167 | + Python++ |
| 168 | + <li> |
| 169 | + Coil |
| 170 | + <li> |
| 171 | + SnakeSkin |
| 172 | + <li> |
| 173 | + CCCP - <b>C</b>onvert <b>C</b>++ <b> |
| 174 | + C</b>lasses to <b>P</b>ython |
| 175 | + <li> |
| 176 | + C<sup>3</sup>PO - <b>C</b>onvert <b>C</b>++ |
| 177 | + <b>C</b>lasses to <b>P</b>ython <b> |
| 178 | + O</b>bjects |
| 179 | + <li> |
| 180 | + PALIN - <b>P</b>ython <b> |
| 181 | + A</b>ugmented-<b>L</b>anguage <b> |
| 182 | + IN</b>tegration |
| 183 | + <li> |
| 184 | + CLEESE - <b>C</b>++ <b>L</b>anguage <b>E</b>xtension <b>E</b>nvironment |
| 185 | + <b>S</b>upremely <b>E</b>asy |
| 186 | + <li> |
| 187 | + JONES - <b>J</b>ust <b>O</b>bscenely <b>N</b>eat <b>E</b>xtension |
| 188 | + <b>S</b>ystem |
| 189 | + <li> |
| 190 | + C-thru |
| 191 | + <li> |
| 192 | + SeamlessC |
| 193 | + <li> |
| 194 | + BorderCrossing |
| 195 | + <li> |
| 196 | + Perseus (because he solved a hairy problem involving snakes by using |
| 197 | + reflection and was invisible most of the time). |
| 198 | + </ul> |
| 199 | + Please <a href="http://www.egroups.com/list/boost">post</a> or send <a |
| 200 | + href="http:mailto: [email protected]">me</a> your suggestions!<br> |
| 201 | + <br> |
| 202 | + |
| 203 | + <p> |
| 204 | + © Copyright David Abrahams 2000. Permission to copy, use, modify, |
| 205 | + sell and distribute this document is granted provided this copyright |
| 206 | + notice appears in all copies. This document is provided “as is” without |
| 207 | + express or implied warranty, and with no claim as to its suitability for |
| 208 | + any purpose. |
| 209 | + <p> |
| 210 | + Updated: Nov 26, 2000 |
| 211 | + |
| 212 | + |
0 commit comments