Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: downloads/boost_1_34_1/libs/python/doc/v2/Apr2002.html @ 45

Last change on this file since 45 was 29, checked in by landauf, 17 years ago

updated boost from 1_33_1 to 1_34_1

File size: 6.9 KB
Line 
1<!-- Copyright David Abrahams 2006. Distributed under the Boost -->
2<!-- Software License, Version 1.0. (See accompanying -->
3<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
4<html>
5<head>
6<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
7<link rel="stylesheet" type="text/css" href="../boost.css">
8<title>Boost.Python - April 2002 Progress Report</title>
9</head>
10<body link="#0000ff" vlink="#800080">
11<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
12    "header">
13  <tr> 
14    <td valign="top" width="300"> 
15          <h3><a href="../../../../index.htm"><img height="86" width="277" alt=
16          "C++ Boost" src="../../../../boost.png" border="0"></a></h3>
17    </td>
18    <td valign="top"> 
19      <h1 align="center"><a href="../index.html">Boost.Python</a></h1>
20      <h2 align="center">April 2002 Progress Report</h2>
21    </td>
22  </tr>
23</table>
24<hr>
25<h2>Contents</h2>
26<dl class="index">
27  <dt><a href="#accomplishments">Accomplishments</a></dt>
28  <dl class="index">
29    <dt><a href="#arity">Arbitrary Arity Support</a></dt>
30    <dt><a href="#callbacks">New Callback Interface</a></dt>
31    <dt><a href="#policies">Call Policies for Construtors</a></dt>
32    <dt><a href="#bugs">Real Users, Real Bugs</a></dt>
33    <dt><a href="#insights">New Insights</a></dt>
34    <dt><a href="#v1">Boost.Python V1 Maintenance</a></dt>
35  </dl>
36
37  <dt><a href="#missing">What's Missing</a></dt>
38
39</dl>
40
41<h2><a name="accomplishments">Accomplishments</a></h2>
42
43April was a short month as far as Boost.Python was concerned, since
44the spring ISO C++ Committee Meeting (and associated vacation)
45occupied me for the 2nd half of the month. However, a suprising amount
46of work got done...
47
48<h3><a name="arity">Arbitrary Arity Support</a></h3>
49
50I began using the <a
51href="../../../preprocessor/doc/index.html">Boost.Preprocessor</a>
52metaprogramming library to generate support for functions and member
53functions of arbitrary arity, which was, to say the least, quite an
54adventure. The feedback cycle resulting from my foray into
55Boost.Preprocessor resulted in several improvements to the library,
56most notably in its documentation.
57
58<p>
59
60Boost.Python now supports calls of up to 17 arguments on most
61compilers. Because most EDG-based compilers have dismal preprocessor
62performance, I had to &quot;manually&quot; expand the metaprograms for
63arities from zero to fifteen arguments, and EDG-based compilers with
64<code>__EDG_VERSION__&nbsp;&lt;=&nbsp;245</code> only support 15
65arguments by default. If some crazy program finds a need for more than
66the default arity support, users can increase the base support by
67setting the <code>BOOST_PYTHON_MAX_ARITY</code> preprocessor symbol.
68
69<h3><a name="callbacks">New Callback Interface</a></h3>
70
71I mentioned in <a href="Mar2002.html">last month's report</a> that I
72wasn't pleased with the interface for the interface for calling into
73Python, so now it has been redesigned. The new interface is outlined
74in <a
75href="http://mail.python.org/pipermail/c++-sig/2002-April/000953.html">this
76message</a> (though the GCC 2.95.3 bugs have been fixed).
77
78<h3><a name="policies">Call Policies for Constructors</a></h3>
79
80On April 2nd, I <a
81href="http://mail.python.org/pipermail/c++-sig/2002-April/000916.html">announced</a>
82support for the use of call policies with constructors.
83
84<h3><a name="bugs">Real Users, Real Bugs</a></h3>
85
86At least two people outside of Kull began actually using Boost.Python
87v2 in earnest this month. Peter Bienstman and Pearu Pearson both
88provided valuable real-world bug reports that helped me to improve the
89library's robustness.
90
91<h3><a name="insights">New Insights</a></h3>
92
93<a
94href="http://mail.python.org/pipermail/c++-sig/2002-May/001010.html"
95>Answering some of Pearu's questions</a> about explicitly converting
96objects between Python and C++ actually led me to a new understanding
97of the role of the current conversion facilities. In Boost.Python v1,
98all conversions between Python and C++ were handled by a single family
99of functions, called <code>to_python()</code> and
100<code>from_python()</code>. Since the primary role of Boost.Python is
101to wrap C++ functions in Python, I used these names for the first kind
102of converters I needed: those that extract C++ objects to be used as
103function arguments and which C++ function return values to
104Python. The better-considered approach in Boost.Python v2 uses a
105completely different mechanism for conversions used when calling
106Python from C++, as in wrapped virtual function implementations. I
107usually think of this as a &quot;callback&quot;, as in &quot;calling
108back into Python&quot;, and I named the converters used in callbacks
109accordingly: <code>to_python_callback</code> and
110<code>from_python_callback</code>. However, as it turns out, the
111behavior of the &quot;callback&quot; converters is the appropriate one
112for users who want to explicitly extract a C++ value from a Python
113object, or create a Python object from a C++ value. The upshot is that
114it probably makes sense to change the name of the existing <code>to_python</code> and
115<code>from_python</code> so those names are available for the
116user-friendly explicit converters.
117
118<p>
119<a
120href="http://mail.python.org/pipermail/c++-sig/2002-May/001013.html">Another
121of Pearu's questions</a> pushes momentum further in the direction of a
122more-sophisticated overloading mechanism than the current
123simple-minded &quot;first match&quot; approach, as I suggested <a
124href="Mar2002.html#implicit_conversions">last month</a>.
125
126<h3><a name="v1">Boost.Python V1 Maintenance</a></h3>
127
128As much as I'm looking forward to retiring Boost.Python v1, a
129significant amount of effort has been being spent dealing with support
130problems; the saying that code rots when left alone is true, and
131Boost.Python is no exception. Eventually it became obvious to me that
132we were going to have to invest some effort in keeping V1 healthy
133while working on V2. Ralf and I have expanded support for various
134compilers and stabilized the V1 codebase considerably. We discarded
135the obsolete Visual Studio projects which were causing so much
136confusion. Still to do before the next Boost release:
137<ol>
138<li>Update the build/test documentation with detailed instructions for
139configuring various toolsets.
140<li>Provide some links to Boost.Python v2 to let people know what's
141coming.
142</ol>
143
144
145<h2><a name="missing">What's Missing</a></h2>
146
147Last month I announced that I would implement the following which are
148not yet complete:
149<ol>
150<li>Document all implemented features
151<li>Implement conversions for <code>char</code> types. This is
152implemented but not tested, so we have to assume it doesn't work.
153</ol>
154
155These are my first priority for this month (especially the
156documentation).
157
158<p>Revised
159  <!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
160  13 November, 2002
161  <!--webbot bot="Timestamp" endspan i-checksum="39359" -->
162</p>
163<p><i>&copy; Copyright <a href="../../../../people/dave_abrahams.htm">Dave Abrahams</a> 
164  2002. </i></p>
165</body>
166</html>
Note: See TracBrowser for help on using the repository browser.