mirror of
https://github.com/boostorg/python.git
synced 2026-01-20 04:42:28 +00:00
Compare commits
28 Commits
develop
...
boost-1.33
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0e2b1e1069 | ||
|
|
03cb43d1a4 | ||
|
|
d019599a4d | ||
|
|
95a184e424 | ||
|
|
2231448286 | ||
|
|
8367e1d366 | ||
|
|
00582713d5 | ||
|
|
9e588c4ca2 | ||
|
|
ccabeef937 | ||
|
|
fecdada51d | ||
|
|
f0d1de94a0 | ||
|
|
c9bca62047 | ||
|
|
312908b72c | ||
|
|
ae438aa67a | ||
|
|
daf842e534 | ||
|
|
8fa75c8fb5 | ||
|
|
2e8a265abf | ||
|
|
55f6c08095 | ||
|
|
8aa504f190 | ||
|
|
2cede68e3a | ||
|
|
354151926b | ||
|
|
92c9053dcd | ||
|
|
f20e7d5e5c | ||
|
|
0af24b311e | ||
|
|
783c8c422e | ||
|
|
79a25bfd4c | ||
|
|
35472e60e3 | ||
|
|
2aa129a02f |
@@ -82,9 +82,12 @@
|
|||||||
boost installation (if you have already built boost from the top level
|
boost installation (if you have already built boost from the top level
|
||||||
this may have no effect, since the work is already done).</p>
|
this may have no effect, since the work is already done).</p>
|
||||||
|
|
||||||
<h3><a name="configuration">Basic Configuration</a></h3>
|
<h3><a name="configuration">Basic Configuration</a></h3> You may
|
||||||
You may need to configure the following variables to point Boost.Build at
|
need to configure the following variables to point Boost.Build at
|
||||||
your Python installation:
|
your Python installation. Variables can be either set in the
|
||||||
|
environment or passed on the <code>bjam</code> command-line
|
||||||
|
as <code>-s</code><i>name</i><code>=</code><i>value</i>. Variable
|
||||||
|
names are case-sensitive.
|
||||||
|
|
||||||
<table border="1" summary="build configuration variables">
|
<table border="1" summary="build configuration variables">
|
||||||
<tr>
|
<tr>
|
||||||
@@ -98,28 +101,29 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>PYTHON_ROOT</code></td>
|
|
||||||
|
|
||||||
<td>The root directory of your Python installation</td>
|
|
||||||
|
|
||||||
<td>Windows: <code>c:/tools/python</code>
|
|
||||||
Unix: <code>/usr/local</code></td>
|
|
||||||
|
|
||||||
<td>On Unix, this is the <code>--with-prefix=</code> directory used
|
|
||||||
to configure Python</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>PYTHON_VERSION</code></td>
|
<td><code>PYTHON_VERSION</code></td>
|
||||||
|
|
||||||
<td>The The 2-part python Major.Minor version number</td>
|
<td>The The 2-part python Major.Minor version number</td>
|
||||||
|
|
||||||
<td><code>2.2</code></td>
|
<td><code>2.4</code></td>
|
||||||
|
|
||||||
<td>Be sure not to include a third number, e.g. <b>not</b>
|
<td>Be sure not to include a third number, e.g. <b>not</b>
|
||||||
"<code>2.2.1</code>", even if that's the version you have.</td>
|
"<code>2.2.1</code>", even if that's the version you have.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<td><code>PYTHON_ROOT</code></td>
|
||||||
|
|
||||||
|
<td>The root directory of your Python installation</td>
|
||||||
|
|
||||||
|
<td>Windows: <code>c:/Python</code><i>(10*Version)</i>, e.g. <code>c:/Python24</code>
|
||||||
|
<br>
|
||||||
|
*nix/Cygwin: <code>/usr</code></td>
|
||||||
|
|
||||||
|
<td>On *nix, this should be the <code>--prefix=</code> directory used
|
||||||
|
to configure Python when it was built and installed.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>PYTHON_INCLUDES</code></td>
|
<td><code>PYTHON_INCLUDES</code></td>
|
||||||
|
|
||||||
@@ -172,7 +176,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><code>CYGWIN_PYTHON_[DEBUG_]ROOT</code></td>
|
<td><code>CYGWIN_PYTHON_[DEBUG_]ROOT</code></td>
|
||||||
|
|
||||||
<td>unix-style path containing the <code>include/</code> directory
|
<td>*nix-style path containing the <code>include/</code> directory
|
||||||
containing
|
containing
|
||||||
<code>python$(CYGWIN_PYTHON_[DEBUG_]VERSION)/python.h</code>.</td>
|
<code>python$(CYGWIN_PYTHON_[DEBUG_]VERSION)/python.h</code>.</td>
|
||||||
|
|
||||||
@@ -219,8 +223,10 @@
|
|||||||
<h3><a name="mingw">Notes for MinGW (and Cygwin with -mno-cygwin) GCC
|
<h3><a name="mingw">Notes for MinGW (and Cygwin with -mno-cygwin) GCC
|
||||||
Users</a></h3>
|
Users</a></h3>
|
||||||
|
|
||||||
<p>You will need to create a MinGW-compatible version of the Python
|
<p>If you are using a version of Python prior to 2.4.1 with a
|
||||||
library; the one shipped with Python will only work with a
|
MinGW prior to 3.0.0 (with binutils-2.13.90-20030111-1), you will
|
||||||
|
need to create a MinGW-compatible version of the Python library;
|
||||||
|
the one shipped with Python will only work with a
|
||||||
Microsoft-compatible linker. Follow the instructions in the
|
Microsoft-compatible linker. Follow the instructions in the
|
||||||
"Non-Microsoft" section of the "Building Extensions: Tips And Tricks"
|
"Non-Microsoft" section of the "Building Extensions: Tips And Tricks"
|
||||||
chapter in <a href=
|
chapter in <a href=
|
||||||
@@ -302,7 +308,7 @@ bjam -sTOOLS=<i><a href=
|
|||||||
right places.
|
right places.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<p>The <code><a href="../example">libs/python/example</a></code>
|
<p>The <code>libs/python/example</code>
|
||||||
subdirectory of your boost installation contains a small example which
|
subdirectory of your boost installation contains a small example which
|
||||||
builds and tests two extensions. To build your own extensions copy the
|
builds and tests two extensions. To build your own extensions copy the
|
||||||
example subproject and make the following two edits:</p>
|
example subproject and make the following two edits:</p>
|
||||||
@@ -359,7 +365,7 @@ path-global BOOST_ROOT : ../../.. ;
|
|||||||
<p>The first two variants of the <code>boost_python</code> library are
|
<p>The first two variants of the <code>boost_python</code> library are
|
||||||
built by default, and are compatible with the default Python
|
built by default, and are compatible with the default Python
|
||||||
distribution. The <code>debug-python</code> variant corresponds to a
|
distribution. The <code>debug-python</code> variant corresponds to a
|
||||||
specially-built debugging version of Python. On Unix platforms, this
|
specially-built debugging version of Python. On *nix platforms, this
|
||||||
python is built by adding <code>--with-pydebug</code> when configuring
|
python is built by adding <code>--with-pydebug</code> when configuring
|
||||||
the Python build. On Windows, the debugging version of Python is
|
the Python build. On Windows, the debugging version of Python is
|
||||||
generated by the "Win32 Debug" target of the <code>PCBuild.dsw</code>
|
generated by the "Win32 Debug" target of the <code>PCBuild.dsw</code>
|
||||||
@@ -396,8 +402,8 @@ path-global BOOST_ROOT : ../../.. ;
|
|||||||
IDE</a></h2>
|
IDE</a></h2>
|
||||||
|
|
||||||
<p>For the those of you who feel more comfortable in the IDE world, a
|
<p>For the those of you who feel more comfortable in the IDE world, a
|
||||||
workspace and project file have been included in the <a href=
|
workspace and project file have been included in the <code>
|
||||||
"../build/VisualStudio">libs/python/build/VisualStudio</a> subdirectory.
|
libs/python/build/VisualStudio</code> subdirectory.
|
||||||
It builds release and debug versions of the Boost.Python libraries and
|
It builds release and debug versions of the Boost.Python libraries and
|
||||||
places them and the same directory as Jamfile build does, though the
|
places them and the same directory as Jamfile build does, though the
|
||||||
intermediate object files are placed in a different directory. The files
|
intermediate object files are placed in a different directory. The files
|
||||||
|
|||||||
363
doc/news.html
363
doc/news.html
@@ -1,105 +1,171 @@
|
|||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||||
|
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<meta name="generator" content=
|
<meta name="generator" content=
|
||||||
"HTML Tidy for Cygwin (vers 1st April 2002), see www.w3.org">
|
"HTML Tidy for Cygwin (vers 1st September 2004), see www.w3.org">
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
|
||||||
<link rel="stylesheet" type="text/css" href="boost.css">
|
<link rel="stylesheet" type="text/css" href="boost.css">
|
||||||
|
|
||||||
<title>Boost.Python - News/Change Log</title>
|
<title>Boost.Python - News/Change Log</title>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body link="#0000ff" vlink="#800080">
|
<body link="#0000FF" vlink="#800080">
|
||||||
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
|
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
|
||||||
"header">
|
"header">
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="top" width="300">
|
<td valign="top" width="300">
|
||||||
<h3><a href="../../../index.htm"><img height="86" width="277" alt=
|
<h3><a href="../../../index.htm"><img height="86" width="277" alt=
|
||||||
"C++ Boost" src="../../../boost.png" border="0"></a></h3>
|
"C++ Boost" src="../../../boost.png" border="0"></a></h3>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td valign="top">
|
<td valign="top">
|
||||||
<h1 align="center"><a href="index.html">Boost.Python</a></h1>
|
<h1 align="center"><a href="index.html">Boost.Python</a></h1>
|
||||||
|
|
||||||
<h2 align="center">News/Change Log</h2>
|
<h2 align="center">News/Change Log</h2>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<dl class="page-index">
|
<dl class="page-index">
|
||||||
<dt>11 March 2005</dt>
|
<dt>19 October 2005 - 1.33.1 release</dt>
|
||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<ul>
|
<ul>
|
||||||
<li>Added a hack that will fool PyDoc into working with Boost.Python, thanks to Nick Rasmussen</li>
|
<li><code>wrapper<T></code> can now be used as expected with a
|
||||||
</ul>
|
held type of <i>some-smart-pointer</i><code><T></code></li>
|
||||||
</dd>
|
|
||||||
<dt>19 November 2004 - 1.32 release</dt>
|
|
||||||
|
|
||||||
<dd>
|
<li>The build now assumes Python 2.4 by default, rather than 2.2</li>
|
||||||
<ul>
|
|
||||||
<li>Updated to use the Boost Software License.</li>
|
|
||||||
<li>A new, <a href="tutorial/doc/html/python/exposing.html#python.class_virtual_functions">better method of wrapping classes with virtual functions</a> has been implemented.</li>
|
|
||||||
<li>Support for upcoming GCC symbol export control features have been folded in, thanks to Niall Douglas.</li>
|
|
||||||
<li>Improved support for <code>std::auto_ptr</code>-like types.</li>
|
|
||||||
<li>The Visual C++ bug that makes top-level <i>cv-qualification</i> of function parameter types part of the function type has been worked around.</li>
|
|
||||||
<li>Components used by other libraries have been moved out of <code>python/detail</code> and into <code> boost/detail</code> to improve dependency relationships.</li>
|
|
||||||
<li>Miscellaneous bug fixes and compiler workarounds.</li>
|
|
||||||
</ul>
|
|
||||||
</dd>
|
|
||||||
<dt>8 Sept 2004</dt>
|
|
||||||
|
|
||||||
<dd>
|
<li>Support Python that's built without Unicode support</li>
|
||||||
Support for Python's Bool type, thanks to <a
|
|
||||||
mailto="dholth-at-fastmail.fm">Daniel Holth</a>.
|
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>11 Sept 2003</dt>
|
<li>Support for wrapping classes with overloaded address-of
|
||||||
|
(<code>&</code>) operators</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dd>
|
<dt>14 August 2005 - 1.33 release</dt>
|
||||||
<ul>
|
|
||||||
<li>Changed the response to multiple to-python converters being
|
|
||||||
registered for the same type from a hard error into warning;
|
|
||||||
Boost.Python now reports the offending type in the message.</li>
|
|
||||||
|
|
||||||
<li>Added builtin <code>std::wstring</code> conversions</li>
|
<dd>
|
||||||
|
<ul>
|
||||||
|
<li>Support for docstrings on nonstatic properties.</li>
|
||||||
|
|
||||||
<li>Added <code>std::out_of_range</code> => Python
|
<li>We now export the client-provided docstrings for
|
||||||
<code>IndexError</code> exception conversion, thanks to <a href=
|
<code>init<optional<> ></code> and
|
||||||
"mailto:RaoulGough-at-yahoo.co.uk">Raoul Gough</a></li>
|
<i>XXX</i><code>_FUNCTION_OVERLOADS()</code> for only the last
|
||||||
</ul>
|
overload.</li>
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>9 Sept 2003</dt>
|
<li>Fixed some support for Embedded VC++ 4</li>
|
||||||
|
|
||||||
<dd>Added new <code><a href="v2/str.html#str-spec">str</a></code></dd>
|
<li>Better support for rvalue from-python conversions of shared_ptr:
|
||||||
|
always return a pointer that holds the owning python object *unless*
|
||||||
|
the python object contains a NULL shared_ptr holder of the right
|
||||||
|
type.</li>
|
||||||
|
|
||||||
<dt>constructors which take a range of characters, allowing strings
|
<li>Support for exposing <code>vector<T*></code> with the
|
||||||
containing nul (<code>'\0'</code>) characters.</dt>
|
indexing suite.</li>
|
||||||
|
|
||||||
<dt>8 Sept 2003</dt>
|
<li>Support for GCC-3.3 on MacOS.</li>
|
||||||
|
|
||||||
<dd>Added the ability to create methods from function objects (with an
|
<li>updated visual studio project build file to include two new files
|
||||||
<code>operator()</code>); see the <a href=
|
(slice.cpp and wrapper.cpp)</li>
|
||||||
"v2/make_function.html#make_function-spec">make_function</a> docs for
|
|
||||||
more info.</dd>
|
|
||||||
|
|
||||||
<dt>10 August 2003</dt>
|
<li>Added search feature to the index page.</li>
|
||||||
|
|
||||||
<dd>Added the new <code>properties</code> unit tests contributed by <a
|
<li>Numerous fixes to the tutorial</li>
|
||||||
href="mailto:romany-at-actimize.com">Roman Yakovenko</a> and documented
|
|
||||||
<code>add_static_property</code> at his urging.</dd>
|
|
||||||
|
|
||||||
<dt>1 August 2003</dt>
|
<li>Numerous workarounds for MSVC 6 and 7, GCC 2.96, and EDG
|
||||||
|
2.45</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
<dd>
|
<dt>11 March 2005</dt>
|
||||||
Added the new <code>arg</code> class contributed by <a href=
|
|
||||||
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a> which supplies the
|
<dd>
|
||||||
ability to wrap functions that can be called with ommitted arguments
|
<ul>
|
||||||
in the middle:
|
<li>Added a hack that will fool PyDoc into working with Boost.Python,
|
||||||
<pre>
|
thanks to Nick Rasmussen</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>19 November 2004 - 1.32 release</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
<ul>
|
||||||
|
<li>Updated to use the Boost Software License.</li>
|
||||||
|
|
||||||
|
<li>A new, <a href=
|
||||||
|
"tutorial/doc/html/python/exposing.html#python.class_virtual_functions">
|
||||||
|
better method of wrapping classes with virtual functions</a> has been
|
||||||
|
implemented.</li>
|
||||||
|
|
||||||
|
<li>Support for upcoming GCC symbol export control features have been
|
||||||
|
folded in, thanks to Niall Douglas.</li>
|
||||||
|
|
||||||
|
<li>Improved support for <code>std::auto_ptr</code>-like types.</li>
|
||||||
|
|
||||||
|
<li>The Visual C++ bug that makes top-level <i>cv-qualification</i>
|
||||||
|
of function parameter types part of the function type has been worked
|
||||||
|
around.</li>
|
||||||
|
|
||||||
|
<li>Components used by other libraries have been moved out of
|
||||||
|
<code>python/detail</code> and into <code>boost/detail</code> to
|
||||||
|
improve dependency relationships.</li>
|
||||||
|
|
||||||
|
<li>Miscellaneous bug fixes and compiler workarounds.</li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>8 Sept 2004</dt>
|
||||||
|
|
||||||
|
<dd>Support for Python's Bool type, thanks to <a href=
|
||||||
|
"mailto:dholth-at-fastmail.fm">Daniel Holth</a>.</dd>
|
||||||
|
|
||||||
|
<dt>11 Sept 2003</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
<ul>
|
||||||
|
<li>Changed the response to multiple to-python converters being
|
||||||
|
registered for the same type from a hard error into warning;
|
||||||
|
Boost.Python now reports the offending type in the message.</li>
|
||||||
|
|
||||||
|
<li>Added builtin <code>std::wstring</code> conversions</li>
|
||||||
|
|
||||||
|
<li>Added <code>std::out_of_range</code> => Python
|
||||||
|
<code>IndexError</code> exception conversion, thanks to <a href=
|
||||||
|
"mailto:RaoulGough-at-yahoo.co.uk">Raoul Gough</a></li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
|
||||||
|
<dt>9 Sept 2003</dt>
|
||||||
|
|
||||||
|
<dd>Added new <code><a href="v2/str.html#str-spec">str</a></code></dd>
|
||||||
|
|
||||||
|
<dt>constructors which take a range of characters, allowing strings
|
||||||
|
containing nul (<code>'\0'</code>) characters.</dt>
|
||||||
|
|
||||||
|
<dt>8 Sept 2003</dt>
|
||||||
|
|
||||||
|
<dd>Added the ability to create methods from function objects (with an
|
||||||
|
<code>operator()</code>); see the <a href=
|
||||||
|
"v2/make_function.html#make_function-spec">make_function</a> docs for
|
||||||
|
more info.</dd>
|
||||||
|
|
||||||
|
<dt>10 August 2003</dt>
|
||||||
|
|
||||||
|
<dd>Added the new <code>properties</code> unit tests contributed by
|
||||||
|
<a href="mailto:romany-at-actimize.com">Roman Yakovenko</a> and
|
||||||
|
documented <code>add_static_property</code> at his urging.</dd>
|
||||||
|
|
||||||
|
<dt>1 August 2003</dt>
|
||||||
|
|
||||||
|
<dd>
|
||||||
|
Added the new <code>arg</code> class contributed by <a href=
|
||||||
|
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a> which supplies the
|
||||||
|
ability to wrap functions that can be called with ommitted arguments in
|
||||||
|
the middle:
|
||||||
|
<pre>
|
||||||
void f(int x = 0, double y = 3.14, std::string z = std::string("foo"));
|
void f(int x = 0, double y = 3.14, std::string z = std::string("foo"));
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(test)
|
BOOST_PYTHON_MODULE(test)
|
||||||
@@ -108,111 +174,104 @@ BOOST_PYTHON_MODULE(test)
|
|||||||
, (arg("x", 0), arg("y", 3.14), arg("z", "foo")));
|
, (arg("x", 0), arg("y", 3.14), arg("z", "foo")));
|
||||||
}
|
}
|
||||||
|
|
||||||
</pre>
|
</pre>And in Python:
|
||||||
And in Python:
|
<pre>
|
||||||
<pre>
|
|
||||||
>>> import test
|
>>> import test
|
||||||
>>> f(0, z = "bar")
|
>>> f(0, z = "bar")
|
||||||
>>> f(z = "bar", y = 0.0)
|
>>> f(z = "bar", y = 0.0)
|
||||||
</pre>
|
</pre>Thanks, Nikolay!
|
||||||
Thanks, Nikolay!
|
</dd>
|
||||||
</dd>
|
|
||||||
|
|
||||||
<dt>22 July 2003</dt>
|
<dt>22 July 2003</dt>
|
||||||
|
|
||||||
<dd>Killed the dreaded "bad argument type for builtin operation" error.
|
<dd>Killed the dreaded "bad argument type for builtin operation" error.
|
||||||
Argument errors now show the actual and expected argument types!</dd>
|
Argument errors now show the actual and expected argument types!</dd>
|
||||||
|
|
||||||
<dt>19 July 2003</dt>
|
<dt>19 July 2003</dt>
|
||||||
|
|
||||||
<dd>Added the new <code><a href=
|
<dd>Added the new <code><a href=
|
||||||
"v2/return_arg.html">return_arg</a></code> policy from <a href=
|
"v2/return_arg.html">return_arg</a></code> policy from <a href=
|
||||||
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a>. Thanks,
|
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a>. Thanks, Nikolay!</dd>
|
||||||
Nikolay!</dd>
|
|
||||||
|
|
||||||
<dt>18 March, 2003</dt>
|
<dt>18 March, 2003</dt>
|
||||||
|
|
||||||
<dd><a href="mailto:Gottfried.Ganssauge-at-haufe.de">Gottfried
|
<dd><a href="mailto:Gottfried.Ganssauge-at-haufe.de">Gottfried
|
||||||
Ganßauge</a> has contributed <a href=
|
Ganßauge</a> has contributed <a href=
|
||||||
"v2/opaque_pointer_converter.html">opaque pointer support</a>.<br>
|
"v2/opaque_pointer_converter.html">opaque pointer support</a>.<br>
|
||||||
<a href="mailto:nicodemus-at-globalite.com.br">Bruno da Silva de Oliveira</a>
|
<a href="mailto:nicodemus-at-globalite.com.br">Bruno da Silva de
|
||||||
has contributed the exciting <a href="../pyste/index.html">Pyste</a>
|
Oliveira</a> has contributed the exciting <a href=
|
||||||
("Pie-steh") package.</dd>
|
"../pyste/index.html">Pyste</a> ("Pie-steh") package.</dd>
|
||||||
|
|
||||||
<dt>24 February 2003</dt>
|
<dt>24 February 2003</dt>
|
||||||
|
|
||||||
<dd>Finished improved support for <code>boost::shared_ptr</code>. Now
|
<dd>Finished improved support for <code>boost::shared_ptr</code>. Now any
|
||||||
any wrapped object of C++ class <code>X</code> can be converted
|
wrapped object of C++ class <code>X</code> can be converted automatically
|
||||||
automatically to <code>shared_ptr<X></code>, regardless of how it
|
to <code>shared_ptr<X></code>, regardless of how it was wrapped.
|
||||||
was wrapped. The <code>shared_ptr</code> will manage the lifetime of
|
The <code>shared_ptr</code> will manage the lifetime of the Python object
|
||||||
the Python object which supplied the <code>X</code>, rather than just
|
which supplied the <code>X</code>, rather than just the <code>X</code>
|
||||||
the <code>X</code> object itself, and when such a
|
object itself, and when such a <code>shared_ptr</code> is converted back
|
||||||
<code>shared_ptr</code> is converted back to Python, the original
|
to Python, the original Python object will be returned.</dd>
|
||||||
Python object will be returned.</dd>
|
|
||||||
|
|
||||||
<dt>19 January 2003</dt>
|
<dt>19 January 2003</dt>
|
||||||
|
|
||||||
<dd>Integrated <code>staticmethod</code> support from <a href=
|
<dd>Integrated <code>staticmethod</code> support from <a href=
|
||||||
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a>. Thanks,
|
"mailto:nickm-at-sitius.com">Nikolay Mladenov</a>. Thanks, Nikolay!</dd>
|
||||||
Nikolay!</dd>
|
|
||||||
|
|
||||||
<dt>29 December 2002</dt>
|
<dt>29 December 2002</dt>
|
||||||
|
|
||||||
<dd>Added Visual Studio project file and instructions from Brett
|
<dd>Added Visual Studio project file and instructions from Brett Calcott.
|
||||||
Calcott. Thanks, Brett!</dd>
|
Thanks, Brett!</dd>
|
||||||
|
|
||||||
<dt>20 December 2002</dt>
|
<dt>20 December 2002</dt>
|
||||||
|
|
||||||
<dd>Added automatic downcasting for pointers, references, and smart
|
<dd>Added automatic downcasting for pointers, references, and smart
|
||||||
pointers to polymorphic class types upon conversion to python</dd>
|
pointers to polymorphic class types upon conversion to python</dd>
|
||||||
|
|
||||||
<dt>18 December 2002</dt>
|
<dt>18 December 2002</dt>
|
||||||
|
|
||||||
<dd>Optimized from_python conversions for wrapped classes by putting
|
<dd>Optimized from_python conversions for wrapped classes by putting the
|
||||||
the conversion logic in the shared library instead of registering
|
conversion logic in the shared library instead of registering separate
|
||||||
separate converters for each class in each extension module</dd>
|
converters for each class in each extension module</dd>
|
||||||
|
|
||||||
<dt>19 November 2002</dt>
|
<dt>19 November 2002</dt>
|
||||||
|
|
||||||
<dd>Removed the need for users to cast base class member function
|
<dd>Removed the need for users to cast base class member function
|
||||||
pointers when used as arguments to <a href=
|
pointers when used as arguments to <a href=
|
||||||
"v2/class.html#class_-spec-modifiers">add_property</a></dd>
|
"v2/class.html#class_-spec-modifiers">add_property</a></dd>
|
||||||
|
|
||||||
<dt>13 December 2002</dt>
|
<dt>13 December 2002</dt>
|
||||||
|
|
||||||
<dd>Allow exporting of <a href=
|
<dd>Allow exporting of <a href=
|
||||||
"v2/enum.html#enum_-spec"><code>enum_</code></a> values into enclosing
|
"v2/enum.html#enum_-spec"><code>enum_</code></a> values into enclosing
|
||||||
<a href="v2/scope.html#scope-spec"><code>scope</code></a>.<br>
|
<a href="v2/scope.html#scope-spec"><code>scope</code></a>.<br>
|
||||||
Fixed unsigned integer conversions to deal correctly with numbers that
|
Fixed unsigned integer conversions to deal correctly with numbers that
|
||||||
are out-of-range of <code>signed long</code>.</dd>
|
are out-of-range of <code>signed long</code>.</dd>
|
||||||
|
|
||||||
<dt>14 November 2002</dt>
|
<dt>14 November 2002</dt>
|
||||||
|
|
||||||
<dd>Auto-detection of class data members wrapped with <a href=
|
<dd>Auto-detection of class data members wrapped with <a href=
|
||||||
"v2/data_members.html#make_getter-spec"><code>make_getter</code></a></dd>
|
"v2/data_members.html#make_getter-spec"><code>make_getter</code></a></dd>
|
||||||
|
|
||||||
<dt>13 November 2002</dt>
|
<dt>13 November 2002</dt>
|
||||||
|
|
||||||
<dd>Full Support for <code>std::auto_ptr<></code> added.</dd>
|
<dd>Full Support for <code>std::auto_ptr<></code> added.</dd>
|
||||||
|
|
||||||
<dt>October 2002</dt>
|
<dt>October 2002</dt>
|
||||||
|
|
||||||
<dd>Ongoing updates and improvements to tutorial documentation</dd>
|
<dd>Ongoing updates and improvements to tutorial documentation</dd>
|
||||||
|
|
||||||
<dt>10 October 2002</dt>
|
<dt>10 October 2002</dt>
|
||||||
|
|
||||||
<dd>Boost.Python V2 is released!</dd>
|
<dd>Boost.Python V2 is released!</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
<p>Revised
|
<p>Revised
|
||||||
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
|
||||||
19 November 2004
|
19 November 2004
|
||||||
<!--webbot bot="Timestamp" endspan i-checksum="39359" -->
|
<!--webbot bot="Timestamp" endspan i-checksum="39359" --></p>
|
||||||
</p>
|
|
||||||
|
|
||||||
<p><i>© Copyright <a href="../../../people/dave_abrahams.htm">Dave
|
<p><i>© Copyright <a href="../../../people/dave_abrahams.htm">Dave
|
||||||
Abrahams</a> 2002-2003.</i></p>
|
Abrahams</a> 2002-2003.</i></p>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
<dl class="page-index">
|
<dl class="page-index">
|
||||||
<dt><b><a href=
|
<dt><b><a href=
|
||||||
"http://www.neuralynx.com/neuralab/index.htm">NeuraLab</a></b></dt>
|
"http://www.neuralynx.com">NeuraLab</a></b></dt>
|
||||||
|
|
||||||
<dd>Neuralab is a data analysis environment specifically tailored for
|
<dd>Neuralab is a data analysis environment specifically tailored for
|
||||||
neural data from <a href="http://www.neuralynx.com">Neuralynx</a>
|
neural data from <a href="http://www.neuralynx.com">Neuralynx</a>
|
||||||
@@ -351,13 +351,13 @@
|
|||||||
|
|
||||||
<p>Two projects have been developed so far with this technology:</p>
|
<p>Two projects have been developed so far with this technology:</p>
|
||||||
|
|
||||||
<p><b><a href="http://www.esss.com.br/dev_simba.phtml">Simba</a></b>
|
<p><b><a href="http://www.esss.com.br/index.php?pg=dev_projetos">Simba</a></b>
|
||||||
provides 3D visualization of geological formations gattered from the
|
provides 3D visualization of geological formations gattered from the
|
||||||
simulation of the evolution of oil systems, allowing the user to
|
simulation of the evolution of oil systems, allowing the user to
|
||||||
analyse various aspects of the simulation, like deformation, pressure
|
analyse various aspects of the simulation, like deformation, pressure
|
||||||
and fluids, along the time of the simulation.</p>
|
and fluids, along the time of the simulation.</p>
|
||||||
|
|
||||||
<p><b><a href="http://www.esss.com.br/dev_aero.phtml">Aero</a></b>
|
<p><b><a href="http://www.esss.com.br/index.php?pg=dev_projetos">Aero</a></b>
|
||||||
aims to construct a CFD with brazilian technology, which involves
|
aims to construct a CFD with brazilian technology, which involves
|
||||||
various companies and universities. ESSS is responsible for various
|
various companies and universities. ESSS is responsible for various
|
||||||
of the application modules, including GUI and post-processing of
|
of the application modules, including GUI and post-processing of
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ call_method<ResultType>(self_object, "<i>method-name</i>", a1, a2... a<i>N
|
|||||||
the arguments <code>a1</code>...<code>a<i>N</i></code> are copied into
|
the arguments <code>a1</code>...<code>a<i>N</i></code> are copied into
|
||||||
new Python objects, but this behavior can be overridden by the use of
|
new Python objects, but this behavior can be overridden by the use of
|
||||||
<code><a href="ptr.html#ptr-spec">ptr()</a></code> and <a href=
|
<code><a href="ptr.html#ptr-spec">ptr()</a></code> and <a href=
|
||||||
"../../../bind/ref.html#reference_wrapper">ref()</a>:</p>
|
"../../../bind/ref.html">ref()</a>:</p>
|
||||||
<pre>
|
<pre>
|
||||||
class X : boost::noncopyable
|
class X : boost::noncopyable
|
||||||
{
|
{
|
||||||
@@ -128,7 +128,7 @@ void apply(PyObject* callable, X& x)
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><code><a href=
|
<td><code><a href=
|
||||||
"../../../bind/ref.html#reference_wrapper">boost::reference_wrapper</a><T></code></td>
|
"../../../bind/ref.html">boost::reference_wrapper</a><T></code></td>
|
||||||
|
|
||||||
<td>The Python argument contains a pointer to, rather than a copy of,
|
<td>The Python argument contains a pointer to, rather than a copy of,
|
||||||
<code>x.get()</code>. Note: failure to ensure that no Python code
|
<code>x.get()</code>. Note: failure to ensure that no Python code
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -134,7 +134,7 @@ void handle_exception() throw();
|
|||||||
"make_function.html#make_function-spec">make_function</a>()</code>,
|
"make_function.html#make_function-spec">make_function</a>()</code>,
|
||||||
<code><a href=
|
<code><a href=
|
||||||
"make_function.html#make_constructor-spec">make_constructor</a>()</code>,
|
"make_function.html#make_constructor-spec">make_constructor</a>()</code>,
|
||||||
<code><a href="def.html#def-spec">def</a>()</code> and <code><a href=
|
<code><a href="def.html#class_-spec-modifiers">def</a>()</code> and <code><a href=
|
||||||
"class.html#def-spec">class_::def</a>()</code>. The second form can be
|
"class.html#def-spec">class_::def</a>()</code>. The second form can be
|
||||||
more convenient to use (see the <a href="#examples">example</a> below),
|
more convenient to use (see the <a href="#examples">example</a> below),
|
||||||
but various compilers have problems when exceptions are rethrown from
|
but various compilers have problems when exceptions are rethrown from
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
<dt><a href="#iterator-spec-synopsis">Class
|
<dt><a href="#iterator-spec-synopsis">Class
|
||||||
<code>iterator</code> synopsis</a></dt>
|
<code>iterator</code> synopsis</a></dt>
|
||||||
|
|
||||||
<dt><a href="#iterator-spec-ctors">Class template
|
<dt><a href="#iterator-spec-constructors">Class template
|
||||||
<code>iterator</code> constructor</a></dt>
|
<code>iterator</code> constructor</a></dt>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ This macro generates two functions in the scope where it is used:
|
|||||||
and <code>void init_module_<i>name</i>()</code>, whose body must
|
and <code>void init_module_<i>name</i>()</code>, whose body must
|
||||||
follow the macro invocation. <code>init_<i>name</i></code> passes
|
follow the macro invocation. <code>init_<i>name</i></code> passes
|
||||||
<code>init_module_<i>name</i></code> to <code><a
|
<code>init_module_<i>name</i></code> to <code><a
|
||||||
href="errors.html#handle_exception">handle_exception</a>()</code> so
|
href="errors.html#handle_exception-spec">handle_exception</a>()</code> so
|
||||||
that any C++ exceptions generated are safely processeed. During the
|
that any C++ exceptions generated are safely processeed. During the
|
||||||
body of <code>init_<i>name</i></code>, the current <code><a
|
body of <code>init_<i>name</i></code>, the current <code><a
|
||||||
href="scope.html#scope-spec">scope</a></code> refers to the module
|
href="scope.html#scope-spec">scope</a></code> refers to the module
|
||||||
|
|||||||
@@ -186,7 +186,7 @@
|
|||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<dl class="page-index">
|
<dl class="page-index">
|
||||||
<dt><a href="#operators-spec">operators</a></dt>
|
<dt><a href="#object_operators-spec">operators</a></dt>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
@@ -232,7 +232,7 @@ x[slice(_,_,-1)]
|
|||||||
<p>The policies which are used for proxies representing an attribute
|
<p>The policies which are used for proxies representing an attribute
|
||||||
access to a <code>const object</code>.</p>
|
access to a <code>const object</code>.</p>
|
||||||
|
|
||||||
<h4><a name="class-spec-synopsis"></a>Class
|
<h4><a name="const_attribute_policies-spec-synopsis"></a>Class
|
||||||
<code>const_attribute_policies</code> synopsis</h4>
|
<code>const_attribute_policies</code> synopsis</h4>
|
||||||
<pre>
|
<pre>
|
||||||
namespace boost { namespace python { namespace api
|
namespace boost { namespace python { namespace api
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ explicit opaque_pointer_converter(char const* name);
|
|||||||
|
|
||||||
<h2><a name="examples"></a>Example</h2>
|
<h2><a name="examples"></a>Example</h2>
|
||||||
|
|
||||||
please see example for <a href="return_opaque_pointer.html#example">
|
please see example for <a href="return_opaque_pointer.html#examples">
|
||||||
return_opaque_pointer</a>.
|
return_opaque_pointer</a>.
|
||||||
|
|
||||||
<h2><a name="see-also"></a>See Also</h2>
|
<h2><a name="see-also"></a>See Also</h2>
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
<dt><a href="#self_t-spec-value-unary-ops">Class
|
<dt><a href="#self_t-spec-value-unary-ops">Class
|
||||||
<code>self_t</code> unary operations</a></dt>
|
<code>self_t</code> unary operations</a></dt>
|
||||||
|
|
||||||
<dt><a href="#self_t-spec-value-value-ops">Class
|
<dt><a href="#self_t-spec-value-ops">Class
|
||||||
<code>self_t</code> value operations</a></dt>
|
<code>self_t</code> value operations</a></dt>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
|
|||||||
@@ -92,8 +92,8 @@ following examples.
|
|||||||
<hr>
|
<hr>
|
||||||
<h2>Examples</h2>
|
<h2>Examples</h2>
|
||||||
|
|
||||||
There are three files in <a href="../../test/"
|
There are three files in
|
||||||
><tt>boost/libs/python/test</tt></a> that show how to
|
<tt>boost/libs/python/test</tt> that show how to
|
||||||
provide pickle support.
|
provide pickle support.
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|||||||
@@ -51,13 +51,11 @@
|
|||||||
3.1, and 3.2 on <a href="http://www.redhat.com">RedHat Linux 7.3</a>
|
3.1, and 3.2 on <a href="http://www.redhat.com">RedHat Linux 7.3</a>
|
||||||
for Intel x86</dt>
|
for Intel x86</dt>
|
||||||
|
|
||||||
<dt><a href=
|
<dt>Tru64 CXX 6.5.1 on OSF v. 5.1 for Dec/Compaq
|
||||||
"http://www.tru64unix.compaq.com/cplus/index.html">Tru64 CXX
|
Alpha</dt>
|
||||||
6.5.1</a> on OSF v. 5.1 for Dec/Compaq Alpha</dt>
|
|
||||||
|
|
||||||
<dt><a href=
|
<dt>
|
||||||
"http://www.sgi.com/developers/devtools/languages/mipspro.html">
|
MIPSPro 7.3.1.2m on <a href=
|
||||||
MIPSPro 7.3.1.2m</a> on <a href=
|
|
||||||
"http://www.sgi.com/software/irix6.5/">IRIX 6.5</a> for SGI
|
"http://www.sgi.com/software/irix6.5/">IRIX 6.5</a> for SGI
|
||||||
mips</dt>
|
mips</dt>
|
||||||
|
|
||||||
@@ -70,21 +68,16 @@
|
|||||||
|
|
||||||
<dd>
|
<dd>
|
||||||
<dl>
|
<dl>
|
||||||
<dt><a href=
|
<dt>KCC 3.4d on OSF v. 5.1 for Dec/Compaq Alpha</dt>
|
||||||
"http://developer.intel.com/software/products/kcc/">KCC
|
|
||||||
3.4d</a> on OSF v. 5.1 for Dec/Compaq Alpha</dt>
|
|
||||||
|
|
||||||
<dt><a href=
|
<dt>KCC 3.4d</a> on AIX</dt>
|
||||||
"http://developer.intel.com/software/products/kcc/">KCC
|
|
||||||
3.4d</a> on AIX</dt>
|
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
<br>
|
<br>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
||||||
<dt><a href="http://www.microsoft.com/windowsxp/default.asp">Microsoft
|
<dt>Microsoft Windows XP Professional with Python <a href=
|
||||||
Windows XP Professional</a> with Python <a href=
|
|
||||||
"http://www.python.org/2.2">2.2</a>, <a href=
|
"http://www.python.org/2.2">2.2</a>, <a href=
|
||||||
"http://www.python.org/2.2.1">2.2.1</a>, and <a href=
|
"http://www.python.org/2.2.1">2.2.1</a>, and <a href=
|
||||||
"http://www.python.org/2.2.2">2.2.2b1</a>:</dt>
|
"http://www.python.org/2.2.2">2.2.2b1</a>:</dt>
|
||||||
|
|||||||
@@ -45,8 +45,8 @@
|
|||||||
|
|
||||||
<p><code><boost/python/pointee.hpp></code> introduces a
|
<p><code><boost/python/pointee.hpp></code> introduces a
|
||||||
traits <a
|
traits <a
|
||||||
href="../../../mpl/doc/index.html#metafunctions">metafunction</a>
|
href="../../../mpl/doc/refmanual/metafunction.html">metafunction</a>
|
||||||
template <code>pointee<T></code> which can be used to extract the "pointed-to" type from the type of a pointer or smart pointer.
|
template <code>pointee<T></code> that can be used to extract the "pointed-to" type from the type of a pointer or smart pointer.
|
||||||
|
|
||||||
<h2><a name="classes"></a>Classes</h2>
|
<h2><a name="classes"></a>Classes</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
<dt><a href=
|
<dt><a href=
|
||||||
"Dereferenceable.html#Dereferenceable-concept">Dereferenceable</a></dt>
|
"Dereferenceable.html#Dereferenceable-concept">Dereferenceable</a></dt>
|
||||||
|
|
||||||
<dt><a href="Dereferenceable.html#Extractor-concept">Extractor</a></dt>
|
<dt><a href="Extractor.html#Extractor-concept">Extractor</a></dt>
|
||||||
|
|
||||||
<dt><a href=
|
<dt><a href=
|
||||||
"HolderGenerator.html#HolderGenerator-concept">HolderGenerator</a></dt>
|
"HolderGenerator.html#HolderGenerator-concept">HolderGenerator</a></dt>
|
||||||
@@ -981,7 +981,7 @@
|
|||||||
<dd>
|
<dd>
|
||||||
<dl class="index">
|
<dl class="index">
|
||||||
<dt>class template <a href=
|
<dt>class template <a href=
|
||||||
"pointee.html#pointee">pointee</a></dt>
|
"pointee.html#pointee-spec">pointee</a></dt>
|
||||||
</dl>
|
</dl>
|
||||||
</dd>
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@@ -102,9 +102,9 @@ template <class T> struct apply
|
|||||||
|
|
||||||
<dt><b>Returns:</b> <code>typedef <a href=
|
<dt><b>Returns:</b> <code>typedef <a href=
|
||||||
"to_python_indirect.html#to_python_indirect-spec">to_python_indirect</a><T,V>
|
"to_python_indirect.html#to_python_indirect-spec">to_python_indirect</a><T,V>
|
||||||
type</code>, where <code>V</code> is a <a href=
|
type</code>, where <code>V</code> is a class whose
|
||||||
"to_python_indirect.html#HolderObjectGenerator">HolderObjectGenerator</a>
|
static <code>execute</code> function constructs an instance
|
||||||
which constructs an instance holder containing an <i>unowned</i>
|
holder containing an <i>unowned</i>
|
||||||
<code>U*</code> pointing to the referent of the wrapped function's
|
<code>U*</code> pointing to the referent of the wrapped function's
|
||||||
return value.</dt>
|
return value.</dt>
|
||||||
</dl>
|
</dl>
|
||||||
|
|||||||
@@ -137,8 +137,8 @@ namespace boost { namespace python
|
|||||||
}}
|
}}
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
<h4><a name="default_call_policies-spec-statics"></a>Class
|
<h4><a name="return_internal_reference-spec-statics"></a>Class
|
||||||
<code>default_call_policies</code> static functions</h4>
|
<code>return_internal_reference</code> static functions</h4>
|
||||||
<pre>
|
<pre>
|
||||||
PyObject* postcall(PyObject* args, PyObject* result);
|
PyObject* postcall(PyObject* args, PyObject* result);
|
||||||
</pre>
|
</pre>
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ for the Python <a
|
|||||||
href="http://www.python.org/doc/2.3.3/api/slice-objects.html">slice</a>
|
href="http://www.python.org/doc/2.3.3/api/slice-objects.html">slice</a>
|
||||||
type.</p>
|
type.</p>
|
||||||
<h2><a name="classes"></a>Classes</h2>
|
<h2><a name="classes"></a>Classes</h2>
|
||||||
<h3><a name="class-spec"></a>Class <code>slice</code></h3>
|
<h3><a name="slice-spec"></a>Class <code>slice</code></h3>
|
||||||
<p>Exposes the extended slicing protocol by wrapping the built-in slice
|
<p>Exposes the extended slicing protocol by wrapping the built-in slice
|
||||||
type. The semantics of the constructors and member functions defined
|
type. The semantics of the constructors and member functions defined
|
||||||
below can be fully understood by reading the <a
|
below can be fully understood by reading the <a
|
||||||
@@ -134,7 +134,7 @@ slice(Int1 start, Int2 stop, Int3 step);
|
|||||||
<dt><b>Effects:</b> constructs a new slice with start stop and step
|
<dt><b>Effects:</b> constructs a new slice with start stop and step
|
||||||
values. Equivalent to the slice object created
|
values. Equivalent to the slice object created
|
||||||
by the built-in Python function <code><a
|
by the built-in Python function <code><a
|
||||||
href="http://www.python.org/doc/current/lib/built-in-functions.html#12h-62">slice(start,stop,step)</a></code>,
|
href="http://www.python.org/doc/current/lib/built-in-funcs.html">slice(start,stop,step)</a></code>,
|
||||||
or as part of the Python expression <code>base[start:stop:step]</code>.</dt>
|
or as part of the Python expression <code>base[start:stop:step]</code>.</dt>
|
||||||
<dt><b>Throws:</b> <code>error_already_set</code> and sets a Python <code>TypeError</code>
|
<dt><b>Throws:</b> <code>error_already_set</code> and sets a Python <code>TypeError</code>
|
||||||
exception if no conversion is possible from the arguments to type
|
exception if no conversion is possible from the arguments to type
|
||||||
|
|||||||
@@ -29,14 +29,14 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(BOOST_MSVC)
|
# if defined(BOOST_MSVC)
|
||||||
# if _MSC_VER <= 1200
|
# if _MSC_VER < 1300
|
||||||
# define BOOST_MSVC6_OR_EARLIER 1
|
# define BOOST_MSVC6_OR_EARLIER 1
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# pragma warning (disable : 4786) // disable truncated debug symbols
|
# pragma warning (disable : 4786) // disable truncated debug symbols
|
||||||
# pragma warning (disable : 4251) // disable exported dll function
|
# pragma warning (disable : 4251) // disable exported dll function
|
||||||
# pragma warning (disable : 4800) //'int' : forcing value to bool 'true' or 'false'
|
# pragma warning (disable : 4800) //'int' : forcing value to bool 'true' or 'false'
|
||||||
# pragma warning (disable : 4275) // non dll-interface class
|
# pragma warning (disable : 4275) // non dll-interface class
|
||||||
|
|
||||||
# elif defined(__ICL) && __ICL < 600 // Intel C++ 5
|
# elif defined(__ICL) && __ICL < 600 // Intel C++ 5
|
||||||
|
|
||||||
@@ -68,13 +68,13 @@
|
|||||||
|
|
||||||
#if defined(BOOST_PYTHON_DYNAMIC_LIB)
|
#if defined(BOOST_PYTHON_DYNAMIC_LIB)
|
||||||
|
|
||||||
# if !defined(_WIN32) && !defined(__CYGWIN__) \
|
# if !defined(_WIN32) && !defined(__CYGWIN__) \
|
||||||
&& defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5 \
|
&& !defined(BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY) \
|
||||||
&& !defined(BOOST_PYTHON_GCC_SYMBOL_VISIBILITY)
|
&& BOOST_WORKAROUND(__GNUC__, >= 3) && (__GNUC_MINOR__ >=5 || __GNUC__ > 3)
|
||||||
# define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
|
# define BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY 1
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if defined(BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY)
|
# if BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
|
||||||
# if defined(BOOST_PYTHON_SOURCE)
|
# if defined(BOOST_PYTHON_SOURCE)
|
||||||
# define BOOST_PYTHON_DECL __attribute__ ((visibility("default")))
|
# define BOOST_PYTHON_DECL __attribute__ ((visibility("default")))
|
||||||
# define BOOST_PYTHON_BUILD_DLL
|
# define BOOST_PYTHON_BUILD_DLL
|
||||||
|
|||||||
@@ -1,62 +1,13 @@
|
|||||||
// Copyright David Abrahams 2003.
|
// Copyright David Abrahams 2005.
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
// http://www.boost.org/LICENSE_1_0.txt)
|
// http://www.boost.org/LICENSE_1_0.txt)
|
||||||
#ifndef IS_XXX_DWA2003224_HPP
|
#ifndef IS_XXX_DWA2003224_HPP
|
||||||
# define IS_XXX_DWA2003224_HPP
|
# define IS_XXX_DWA2003224_HPP
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
# include <boost/detail/is_xxx.hpp>
|
||||||
# include <boost/mpl/bool.hpp>
|
|
||||||
# include <boost/preprocessor/enum_params.hpp>
|
|
||||||
|
|
||||||
# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
|
||||||
# include <boost/type_traits/is_reference.hpp>
|
BOOST_DETAIL_IS_XXX_DEF(name, qualified_name, nargs)
|
||||||
# include <boost/type_traits/add_reference.hpp>
|
|
||||||
|
|
||||||
# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
|
|
||||||
template <class X_> \
|
|
||||||
struct is_##name \
|
|
||||||
{ \
|
|
||||||
typedef char yes; \
|
|
||||||
typedef char (&no)[2]; \
|
|
||||||
\
|
|
||||||
static typename add_reference<X_>::type dummy; \
|
|
||||||
\
|
|
||||||
struct helpers \
|
|
||||||
{ \
|
|
||||||
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class U) > \
|
|
||||||
static yes test( \
|
|
||||||
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, U) >&, int \
|
|
||||||
); \
|
|
||||||
\
|
|
||||||
template <class U> \
|
|
||||||
static no test(U&, ...); \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
BOOST_STATIC_CONSTANT( \
|
|
||||||
bool, value \
|
|
||||||
= !is_reference<X_>::value \
|
|
||||||
& (sizeof(helpers::test(dummy, 0)) == sizeof(yes))); \
|
|
||||||
\
|
|
||||||
typedef mpl::bool_<value> type; \
|
|
||||||
};
|
|
||||||
|
|
||||||
# else
|
|
||||||
|
|
||||||
# define BOOST_PYTHON_IS_XXX_DEF(name, qualified_name, nargs) \
|
|
||||||
template <class T> \
|
|
||||||
struct is_##name : mpl::false_ \
|
|
||||||
{ \
|
|
||||||
}; \
|
|
||||||
\
|
|
||||||
template < BOOST_PP_ENUM_PARAMS_Z(1, nargs, class T) > \
|
|
||||||
struct is_##name< \
|
|
||||||
qualified_name< BOOST_PP_ENUM_PARAMS_Z(1, nargs, T) > \
|
|
||||||
> \
|
|
||||||
: mpl::true_ \
|
|
||||||
{ \
|
|
||||||
};
|
|
||||||
|
|
||||||
# endif
|
|
||||||
|
|
||||||
#endif // IS_XXX_DWA2003224_HPP
|
#endif // IS_XXX_DWA2003224_HPP
|
||||||
|
|||||||
@@ -22,6 +22,26 @@
|
|||||||
|
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
# ifndef BOOST_DEBUG_PYTHON
|
# ifndef BOOST_DEBUG_PYTHON
|
||||||
|
# ifdef _MSC_VER
|
||||||
|
// VC8.0 will complain if system headers are #included both with
|
||||||
|
// and without _DEBUG defined, so we have to #include all the
|
||||||
|
// system headers used by pyconfig.h right here.
|
||||||
|
# include <stddef.h>
|
||||||
|
# include <stdarg.h>
|
||||||
|
# include <stdio.h>
|
||||||
|
# include <stdlib.h>
|
||||||
|
# include <assert.h>
|
||||||
|
# include <errno.h>
|
||||||
|
# include <ctype.h>
|
||||||
|
# include <wchar.h>
|
||||||
|
# include <basetsd.h>
|
||||||
|
# include <io.h>
|
||||||
|
# include <limits.h>
|
||||||
|
# include <float.h>
|
||||||
|
# include <string.h>
|
||||||
|
# include <math.h>
|
||||||
|
# include <time.h>
|
||||||
|
# endif
|
||||||
# undef _DEBUG // Don't let Python force the debug library just because we're debugging.
|
# undef _DEBUG // Don't let Python force the debug library just because we're debugging.
|
||||||
# define DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
# define DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
||||||
# endif
|
# endif
|
||||||
@@ -143,6 +163,10 @@ typedef int pid_t;
|
|||||||
#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
#ifdef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
||||||
# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
# undef DEBUG_UNDEFINED_FROM_WRAP_PYTHON_H
|
||||||
# define _DEBUG
|
# define _DEBUG
|
||||||
|
# ifdef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
|
||||||
|
# undef _CRT_NOFORCE_MANIFEST_DEFINED_FROM_WRAP_PYTHON_H
|
||||||
|
# undef _CRT_NOFORCE_MANIFEST
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(PY_MAJOR_VERSION) || PY_MAJOR_VERSION < 2
|
#if !defined(PY_MAJOR_VERSION) || PY_MAJOR_VERSION < 2
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ extern "C" \
|
|||||||
} \
|
} \
|
||||||
void init_module_##name()
|
void init_module_##name()
|
||||||
|
|
||||||
# elif (defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >=5)
|
# elif BOOST_PYTHON_USE_GCC_SYMBOL_VISIBILITY
|
||||||
|
|
||||||
# define BOOST_PYTHON_MODULE_INIT(name) \
|
# define BOOST_PYTHON_MODULE_INIT(name) \
|
||||||
void init_module_##name(); \
|
void init_module_##name(); \
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
# include <boost/mpl/for_each.hpp>
|
# include <boost/mpl/for_each.hpp>
|
||||||
# include <boost/mpl/placeholders.hpp>
|
# include <boost/mpl/placeholders.hpp>
|
||||||
# include <boost/mpl/single_view.hpp>
|
# include <boost/mpl/single_view.hpp>
|
||||||
|
|
||||||
|
# include <boost/mpl/assert.hpp>
|
||||||
|
# include <boost/type_traits/is_same.hpp>
|
||||||
|
|
||||||
# include <boost/type_traits/is_convertible.hpp>
|
# include <boost/type_traits/is_convertible.hpp>
|
||||||
|
|
||||||
# include <boost/noncopyable.hpp>
|
# include <boost/noncopyable.hpp>
|
||||||
@@ -49,6 +53,12 @@ struct register_base_of
|
|||||||
template <class Base>
|
template <class Base>
|
||||||
inline void operator()(Base*) const
|
inline void operator()(Base*) const
|
||||||
{
|
{
|
||||||
|
# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||||
|
BOOST_MPL_ASSERT_NOT((is_same<Base,Derived>));
|
||||||
|
# else
|
||||||
|
BOOST_STATIC_ASSERT(!(is_same<Base,Derived>::value));
|
||||||
|
# endif
|
||||||
|
|
||||||
// Register the Base class
|
// Register the Base class
|
||||||
register_dynamic_id<Base>();
|
register_dynamic_id<Base>();
|
||||||
|
|
||||||
@@ -186,7 +196,7 @@ struct class_metadata
|
|||||||
, mpl::if_<
|
, mpl::if_<
|
||||||
use_value_holder
|
use_value_holder
|
||||||
, value_holder<T>
|
, value_holder<T>
|
||||||
, pointer_holder<held_type,T>
|
, pointer_holder<held_type,wrapped>
|
||||||
>
|
>
|
||||||
>::type holder;
|
>::type holder;
|
||||||
|
|
||||||
@@ -199,7 +209,8 @@ struct class_metadata
|
|||||||
template <class T2>
|
template <class T2>
|
||||||
inline static void register_aux(python::wrapper<T2>*)
|
inline static void register_aux(python::wrapper<T2>*)
|
||||||
{
|
{
|
||||||
class_metadata::register_aux2((T2*)0, mpl::true_());
|
typedef typename mpl::not_<is_same<T2,wrapped> >::type use_callback;
|
||||||
|
class_metadata::register_aux2((T2*)0, use_callback());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline static void register_aux(void*)
|
inline static void register_aux(void*)
|
||||||
@@ -242,6 +253,7 @@ struct class_metadata
|
|||||||
//
|
//
|
||||||
inline static void maybe_register_class_to_python(void*, mpl::true_) {}
|
inline static void maybe_register_class_to_python(void*, mpl::true_) {}
|
||||||
|
|
||||||
|
|
||||||
template <class T2>
|
template <class T2>
|
||||||
inline static void maybe_register_class_to_python(T2*, mpl::false_)
|
inline static void maybe_register_class_to_python(T2*, mpl::false_)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
# include <boost/preprocessor/repetition/enum_params.hpp>
|
# include <boost/preprocessor/repetition/enum_params.hpp>
|
||||||
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
# include <boost/preprocessor/repetition/enum_binary_params.hpp>
|
||||||
|
|
||||||
|
# include <boost/utility/addressof.hpp>
|
||||||
|
|
||||||
namespace boost { namespace python { namespace objects {
|
namespace boost { namespace python { namespace objects {
|
||||||
|
|
||||||
# if BOOST_WORKAROUND(__GNUC__, == 2)
|
# if BOOST_WORKAROUND(__GNUC__, == 2)
|
||||||
@@ -86,12 +88,12 @@ private: // required holder implementation
|
|||||||
template <class Value>
|
template <class Value>
|
||||||
void* value_holder<Value>::holds(type_info dst_t, bool null_ptr_only)
|
void* value_holder<Value>::holds(type_info dst_t, bool null_ptr_only)
|
||||||
{
|
{
|
||||||
if (void* wrapped = holds_wrapped(dst_t, &m_held, &m_held))
|
if (void* wrapped = holds_wrapped(dst_t, boost::addressof(m_held), boost::addressof(m_held)))
|
||||||
return wrapped;
|
return wrapped;
|
||||||
|
|
||||||
type_info src_t = python::type_id<Value>();
|
type_info src_t = python::type_id<Value>();
|
||||||
return src_t == dst_t ? &m_held
|
return src_t == dst_t ? boost::addressof(m_held)
|
||||||
: find_static_type(&m_held, src_t, dst_t);
|
: find_static_type(boost::addressof(m_held), src_t, dst_t);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class Value, class Held>
|
template <class Value, class Held>
|
||||||
@@ -132,7 +134,7 @@ void* value_holder_back_reference<Value,Held>::holds(
|
|||||||
BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil)
|
BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
python::detail::initialize_wrapper(self, &this->m_held);
|
python::detail::initialize_wrapper(self, boost::addressof(this->m_held));
|
||||||
}
|
}
|
||||||
|
|
||||||
# undef N
|
# undef N
|
||||||
|
|||||||
@@ -55,12 +55,15 @@ namespace detail
|
|||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if !defined(BOOST_MSVC) || BOOST_WORKAROUND(_MSC_FULL_VER, > 140040607)
|
# if defined(BOOST_MSVC) && BOOST_WORKAROUND(_MSC_FULL_VER, <= 140040607) || BOOST_WORKAROUND(BOOST_INTEL_WIN, >= 900)
|
||||||
|
// No operator T&
|
||||||
|
# else
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
operator T&() const
|
operator T&() const
|
||||||
{
|
{
|
||||||
converter::return_from_python<T&> converter;
|
converter::return_from_python<T&> converter;
|
||||||
return converter(m_obj.release());
|
return converter(const_cast<handle<>&>(m_obj).release());
|
||||||
}
|
}
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
|||||||
@@ -70,10 +70,8 @@ namespace detail
|
|||||||
: m_pmf(pmf)
|
: m_pmf(pmf)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if !BOOST_WORKAROUND(__EDG_VERSION__, <= 245)
|
|
||||||
private:
|
private:
|
||||||
#endif
|
friend class python::def_visitor_access;
|
||||||
friend class def_visitor_access;
|
|
||||||
|
|
||||||
template <class C_, class Options>
|
template <class C_, class Options>
|
||||||
void visit(C_& c, char const* name, Options& options) const
|
void visit(C_& c, char const* name, Options& options) const
|
||||||
|
|||||||
@@ -21,6 +21,14 @@
|
|||||||
|
|
||||||
# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE
|
# ifdef BOOST_PYTHON_HAVE_GCC_CP_DEMANGLE
|
||||||
# if defined(__GNUC__) && __GNUC__ >= 3
|
# if defined(__GNUC__) && __GNUC__ >= 3
|
||||||
|
|
||||||
|
// http://lists.debian.org/debian-gcc/2003/09/msg00055.html notes
|
||||||
|
// that, in cxxabi.h of gcc-3.x for x < 4, this type is used before it
|
||||||
|
// is declared.
|
||||||
|
# if __GNUC__ == 3 && __GNUC_MINOR__ < 4
|
||||||
|
class __class_type_info;
|
||||||
|
# endif
|
||||||
|
|
||||||
# include <cxxabi.h>
|
# include <cxxabi.h>
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
10
test/Jamfile
10
test/Jamfile
@@ -101,6 +101,10 @@ bpl-test crossmod_exception
|
|||||||
[ bpl-test andreas_beyer ]
|
[ bpl-test andreas_beyer ]
|
||||||
[ bpl-test polymorphism ]
|
[ bpl-test polymorphism ]
|
||||||
[ bpl-test polymorphism2 ]
|
[ bpl-test polymorphism2 ]
|
||||||
|
|
||||||
|
[ bpl-test wrapper_held_type ]
|
||||||
|
[ bpl-test polymorphism2_auto_ptr ]
|
||||||
|
|
||||||
[ bpl-test auto_ptr ]
|
[ bpl-test auto_ptr ]
|
||||||
[ bpl-test minimal ]
|
[ bpl-test minimal ]
|
||||||
[ bpl-test args ]
|
[ bpl-test args ]
|
||||||
@@ -115,7 +119,7 @@ bpl-test crossmod_exception
|
|||||||
[ bpl-test keywords : keywords.cpp keywords_test.py ]
|
[ bpl-test keywords : keywords.cpp keywords_test.py ]
|
||||||
|
|
||||||
[ extension builtin_converters : test_builtin_converters.cpp <template>../build/extension ]
|
[ extension builtin_converters : test_builtin_converters.cpp <template>../build/extension ]
|
||||||
[ boost-python-runtest builtin_converters : test_builtin_converters.py <pyd>builtin_converters ]
|
[ boost-python-runtest builtin_converters : test_builtin_converters.py <pyd>builtin_converters : : : -v ]
|
||||||
|
|
||||||
[ bpl-test test_pointer_adoption ]
|
[ bpl-test test_pointer_adoption ]
|
||||||
[ bpl-test operators ]
|
[ bpl-test operators ]
|
||||||
@@ -164,11 +168,11 @@ bpl-test crossmod_exception
|
|||||||
[ bpl-test vector_indexing_suite ]
|
[ bpl-test vector_indexing_suite ]
|
||||||
[ bpl-test pointer_vector ]
|
[ bpl-test pointer_vector ]
|
||||||
|
|
||||||
|
|
||||||
[ extension map_indexing_suite_ext
|
[ extension map_indexing_suite_ext
|
||||||
: map_indexing_suite.cpp int_map_indexing_suite.cpp <template>../build/extension ]
|
: map_indexing_suite.cpp int_map_indexing_suite.cpp <template>../build/extension ]
|
||||||
|
|
||||||
[ boost-python-runtest
|
[ boost-python-runtest
|
||||||
map_indexing_suite : map_indexing_suite.py <pyd>map_indexing_suite_ext ]
|
map_indexing_suite : map_indexing_suite.py <pyd>map_indexing_suite_ext : : : -v ]
|
||||||
|
|
||||||
# if $(TEST_BIENSTMAN_NON_BUGS)
|
# if $(TEST_BIENSTMAN_NON_BUGS)
|
||||||
# {
|
# {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
#define BOOST_NO_STD_WSTRING
|
|
||||||
// Copyright David Abrahams 2002.
|
// Copyright David Abrahams 2002.
|
||||||
// Distributed under the Boost Software License, Version 1.0. (See
|
// Distributed under the Boost Software License, Version 1.0. (See
|
||||||
// accompanying file LICENSE_1_0.txt or copy at
|
// accompanying file LICENSE_1_0.txt or copy at
|
||||||
|
|||||||
@@ -13,6 +13,14 @@
|
|||||||
#include <boost/python/call.hpp>
|
#include <boost/python/call.hpp>
|
||||||
#include <boost/utility.hpp>
|
#include <boost/utility.hpp>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
#ifdef HELD_BY_AUTO_PTR
|
||||||
|
# define HELD_PTR(X) , std::auto_ptr< X >
|
||||||
|
#else
|
||||||
|
# define HELD_PTR(X)
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace boost::python;
|
using namespace boost::python;
|
||||||
|
|
||||||
struct P
|
struct P
|
||||||
@@ -123,19 +131,23 @@ C& getCCppObj ()
|
|||||||
|
|
||||||
A* pass_a(A* x) { return x; }
|
A* pass_a(A* x) { return x; }
|
||||||
|
|
||||||
|
#ifdef HELD_BY_AUTO_PTR
|
||||||
|
BOOST_PYTHON_MODULE_INIT(polymorphism2_auto_ptr_ext)
|
||||||
|
#else
|
||||||
BOOST_PYTHON_MODULE_INIT(polymorphism2_ext)
|
BOOST_PYTHON_MODULE_INIT(polymorphism2_ext)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
class_<ACallback,boost::noncopyable>("A")
|
class_<ACallback HELD_PTR(A),boost::noncopyable>("A")
|
||||||
.def("f", &A::f, &ACallback::default_f)
|
.def("f", &A::f, &ACallback::default_f)
|
||||||
;
|
;
|
||||||
|
|
||||||
def("getBCppObj", getBCppObj, return_value_policy<reference_existing_object>());
|
def("getBCppObj", getBCppObj, return_value_policy<reference_existing_object>());
|
||||||
|
|
||||||
class_<C,bases<A>,boost::noncopyable>("C")
|
class_<C HELD_PTR(C),bases<A>,boost::noncopyable>("C")
|
||||||
.def("f", &C::f)
|
.def("f", &C::f)
|
||||||
;
|
;
|
||||||
|
|
||||||
class_<DCallback,bases<A>,boost::noncopyable>("D")
|
class_<DCallback HELD_PTR(D),bases<A>,boost::noncopyable>("D")
|
||||||
.def("f", &D::f)
|
.def("f", &D::f)
|
||||||
.def("g", &D::g)
|
.def("g", &D::g)
|
||||||
;
|
;
|
||||||
@@ -152,7 +164,7 @@ BOOST_PYTHON_MODULE_INIT(polymorphism2_ext)
|
|||||||
.def("f", pure_virtual(&P::f))
|
.def("f", pure_virtual(&P::f))
|
||||||
;
|
;
|
||||||
|
|
||||||
class_<Q, bases<P> >("Q")
|
class_<Q HELD_PTR(Q), bases<P> >("Q")
|
||||||
.def("g", &P::g) // make sure virtual inheritance doesn't interfere
|
.def("g", &P::g) // make sure virtual inheritance doesn't interfere
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# Software License, Version 1.0. (See accompanying
|
# Software License, Version 1.0. (See accompanying
|
||||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
import unittest
|
import unittest
|
||||||
from polymorphism2_ext import *
|
import sys
|
||||||
|
|
||||||
class PolymorphTest(unittest.TestCase):
|
class PolymorphTest(unittest.TestCase):
|
||||||
|
|
||||||
@@ -78,10 +78,17 @@ class PolymorphTest(unittest.TestCase):
|
|||||||
self.failUnlessEqual ('R.f', r.f())
|
self.failUnlessEqual ('R.f', r.f())
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def test():
|
||||||
|
# remove the option that upsets unittest
|
||||||
# remove the option which upsets unittest
|
|
||||||
import sys
|
import sys
|
||||||
sys.argv = [ x for x in sys.argv if x != '--broken-auto-ptr' ]
|
sys.argv = [ x for x in sys.argv if x != '--broken-auto-ptr' ]
|
||||||
|
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
|
||||||
|
# This nasty hack basically says that if we're loaded by another module, we'll
|
||||||
|
# be testing polymorphism2_auto_ptr_ext instead of polymorphism2_ext.
|
||||||
|
if __name__ == "__main__":
|
||||||
|
from polymorphism2_ext import *
|
||||||
|
test()
|
||||||
|
else:
|
||||||
|
from polymorphism2_auto_ptr_ext import *
|
||||||
|
|
||||||
|
|||||||
6
test/polymorphism2_auto_ptr.cpp
Executable file
6
test/polymorphism2_auto_ptr.cpp
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||||
|
// Software License, Version 1.0. (See accompanying
|
||||||
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#define HELD_BY_AUTO_PTR
|
||||||
|
#include "polymorphism2.cpp"
|
||||||
5
test/polymorphism2_auto_ptr.py
Normal file
5
test/polymorphism2_auto_ptr.py
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# Copyright David Abrahams 2005. Distributed under the Boost
|
||||||
|
# Software License, Version 1.0. (See accompanying
|
||||||
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
import polymorphism2
|
||||||
|
polymorphism2.test()
|
||||||
@@ -85,14 +85,14 @@ BOOST_PYTHON_MODULE(builtin_converters)
|
|||||||
def("rewrap_value_complex_double", by_value<std::complex<double> >::rewrap);
|
def("rewrap_value_complex_double", by_value<std::complex<double> >::rewrap);
|
||||||
def("rewrap_value_complex_long_double", by_value<std::complex<long double> >::rewrap);
|
def("rewrap_value_complex_long_double", by_value<std::complex<long double> >::rewrap);
|
||||||
def("rewrap_value_wstring",
|
def("rewrap_value_wstring",
|
||||||
# ifdef BOOST_NO_STD_WSTRING
|
# if defined(BOOST_NO_STD_WSTRING) || !defined(Py_USING_UNICODE)
|
||||||
identity_
|
identity_
|
||||||
# else
|
# else
|
||||||
by_value<std::wstring>::rewrap
|
by_value<std::wstring>::rewrap
|
||||||
# endif
|
# endif
|
||||||
);
|
);
|
||||||
def("rewrap_value_string",
|
def("rewrap_value_string",
|
||||||
# ifdef BOOST_NO_STD_WSTRING
|
# if defined(BOOST_NO_STD_WSTRING) || !defined(Py_USING_UNICODE)
|
||||||
identity_
|
identity_
|
||||||
# else
|
# else
|
||||||
by_value<std::wstring>::rewrap
|
by_value<std::wstring>::rewrap
|
||||||
|
|||||||
@@ -78,12 +78,23 @@ r"""
|
|||||||
'hello, world'
|
'hello, world'
|
||||||
>>> rewrap_value_string('yo, wassup?')
|
>>> rewrap_value_string('yo, wassup?')
|
||||||
'yo, wassup?'
|
'yo, wassup?'
|
||||||
>>> rewrap_value_wstring(u'yo, wassup?')
|
|
||||||
|
>>> try:
|
||||||
|
... if unicode: pass
|
||||||
|
... except:
|
||||||
|
... print "u'yo, wassup?'"
|
||||||
|
... else:
|
||||||
|
... eval("rewrap_value_wstring(u'yo, wassup?')")
|
||||||
u'yo, wassup?'
|
u'yo, wassup?'
|
||||||
|
|
||||||
test that overloading on unicode works:
|
test that overloading on unicode works:
|
||||||
|
|
||||||
>>> rewrap_value_string(u'yo, wassup?')
|
>>> try:
|
||||||
|
... if unicode: pass
|
||||||
|
... except:
|
||||||
|
... print "u'yo, wassup?'"
|
||||||
|
... else:
|
||||||
|
... eval("rewrap_value_string(u'yo, wassup?')")
|
||||||
u'yo, wassup?'
|
u'yo, wassup?'
|
||||||
|
|
||||||
wrap strings with embedded nulls:
|
wrap strings with embedded nulls:
|
||||||
|
|||||||
68
test/wrapper_held_type.cpp
Executable file
68
test/wrapper_held_type.cpp
Executable file
@@ -0,0 +1,68 @@
|
|||||||
|
// Copyright David Abrahams 2005. Distributed under the Boost
|
||||||
|
// Software License, Version 1.0. (See accompanying
|
||||||
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
|
||||||
|
#include <boost/python/register_ptr_to_python.hpp>
|
||||||
|
#include <boost/python/def.hpp>
|
||||||
|
#include <boost/python/class.hpp>
|
||||||
|
#include <boost/python/wrapper.hpp>
|
||||||
|
#include <boost/python/module.hpp>
|
||||||
|
#include <boost/python/implicit.hpp>
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
|
struct data
|
||||||
|
{
|
||||||
|
virtual int id() const
|
||||||
|
{
|
||||||
|
return 42;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
std::auto_ptr<data> create_data()
|
||||||
|
{
|
||||||
|
return std::auto_ptr<data>( new data );
|
||||||
|
}
|
||||||
|
|
||||||
|
void do_nothing( std::auto_ptr<data>& ){}
|
||||||
|
|
||||||
|
|
||||||
|
namespace bp = boost::python;
|
||||||
|
|
||||||
|
struct data_wrapper : data, bp::wrapper< data >
|
||||||
|
{
|
||||||
|
data_wrapper(data const & arg )
|
||||||
|
: data( arg )
|
||||||
|
, bp::wrapper< data >()
|
||||||
|
{}
|
||||||
|
|
||||||
|
data_wrapper()
|
||||||
|
: data()
|
||||||
|
, bp::wrapper< data >()
|
||||||
|
{}
|
||||||
|
|
||||||
|
virtual int id() const
|
||||||
|
{
|
||||||
|
if( bp::override id = this->get_override( "id" ) )
|
||||||
|
return bp::call<int>(id.ptr()); // id();
|
||||||
|
else
|
||||||
|
return data::id( );
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual int default_id( ) const
|
||||||
|
{
|
||||||
|
return this->data::id( );
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
BOOST_PYTHON_MODULE(wrapper_held_type_ext)
|
||||||
|
{
|
||||||
|
bp::class_< data_wrapper, std::auto_ptr< data > >( "data" )
|
||||||
|
.def( "id", &data::id, &::data_wrapper::default_id );
|
||||||
|
|
||||||
|
bp::def( "do_nothing", &do_nothing );
|
||||||
|
bp::def( "create_data", &create_data );
|
||||||
|
}
|
||||||
|
|
||||||
|
#include "module_tail.cpp"
|
||||||
34
test/wrapper_held_type.py
Normal file
34
test/wrapper_held_type.py
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# Copyright David Abrahams 2005. Distributed under the Boost
|
||||||
|
# Software License, Version 1.0. (See accompanying
|
||||||
|
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||||
|
'''
|
||||||
|
>>> from wrapper_held_type_ext import *
|
||||||
|
>>> d = data()
|
||||||
|
>>> print d.id()
|
||||||
|
42
|
||||||
|
>>> do_nothing( d )
|
||||||
|
>>> print d.id()
|
||||||
|
42
|
||||||
|
>>> d = create_data()
|
||||||
|
>>> print d.id()
|
||||||
|
42
|
||||||
|
>>> do_nothing( d )
|
||||||
|
>>> print d.id()
|
||||||
|
42
|
||||||
|
'''
|
||||||
|
|
||||||
|
def run(args = None):
|
||||||
|
import sys
|
||||||
|
import doctest
|
||||||
|
|
||||||
|
if args is not None:
|
||||||
|
sys.argv = args
|
||||||
|
return doctest.testmod(sys.modules.get(__name__))
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print "running..."
|
||||||
|
import sys
|
||||||
|
status = run()[0]
|
||||||
|
if (status == 0): print "Done."
|
||||||
|
sys.exit(status)
|
||||||
|
|
||||||
Reference in New Issue
Block a user