2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 16:32:16 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
Daniel James
5496a9facb Quickbook: Merge from trunk.
Includes blocks in lists fixes, and some documentation changes.


[SVN r77347]
2012-03-16 08:48:10 +00:00
Daniel James
a7c22d5bf2 Quickbook: Merge to quickbook-dev
[SVN r76630]
2012-01-21 21:43:17 +00:00
Daniel James
4cec0d1a01 Quickbook: Merge from trunk to quickbook-dev.
[SVN r76255]
2012-01-01 13:35:27 +00:00
Daniel James
d140baeeb0 Quickbook: Merge from trunk to quickbook-dev
[SVN r75739]
2011-11-30 01:35:25 +00:00
Daniel James
6623a7a0ce Quickbook: Copy trunk libs into quickbook-dev branch.
[SVN r75213]
2011-11-01 13:04:29 +00:00
Daniel James
da80082347 Quickbook: Copy trunk headers into quickbook-dev.
[SVN r75212]
2011-11-01 13:03:44 +00:00
Daniel James
07a01cdea4 Quickbook: New branch for development.
From now on this will be my development branch.


[SVN r70613]
2011-03-27 10:17:05 +00:00
14 changed files with 64 additions and 56 deletions

View File

@@ -396,33 +396,27 @@
</blockquote>
</dd>
<dt><b><a href="http://pyrap.googlecode.com/">Pyrap</a></b></dt>
<dd>
<p><a href="diepen@astron.nl"
>Ger van Diepen</a> writes:</p>
<blockquote>
<p>Pyrap is the python interface to the Radio-Astronomical Package
casacore (<a href="http://casacore.googlecode.com/"
>casacore.googlecode.com</a>). Astronomers love pyrap because
it makes it easily possible to get their data (observed with
radio-astronomical telescopes like LOFAR, ASKAP, and eVLA) in numpy
arrays and do basic data inspection and manipulation using the many
python packages that are available.</p>
<p>Boost.Python made it quite easily possible to create converters for
the various data types, also for numpy arrays and individual elements
of a numpy array. It's nice they work fully recursively. Mapping C++
functions to Python was straightforward.</p>
</blockquote>
</dd>
<dt><b><a href="http://www.rdkit.org/"
>RDKit: Cheminformatics and Machine Learning Software</a></b></dt>
<dt><b><a href="http://www.rationaldiscovery.com">Rational Discovery
LLC</a></b></dt>
<dd>
A collection of cheminformatics and machine-learning software
written in C++ and Python.
Rational Discovery provides computational modeling, combinatorial
library design and custom software development services to the
pharmaceutical, biotech and chemical industries. We do a substantial
amount of internal research to develop new approaches for applying
machine-learning techniques to solve chemical problems. Because we're a
small organization and chemistry is a large and complex field, it is
essential that we be able to quickly and easily prototype and test new
algorithms.
<p>For our internal software, we implement core data structures in C
and expose them to Python using Boost.Python. Algorithm development is
done in Python and then translated to C if required (often it's not).
This hybrid development approach not only greatly increases our
productivity, but it also allows "non-developers" (people without C
experience) to take part in method development. Learning C is a
daunting task, but "Python fits your brain." (Thanks to Bruce Eckel for
the quote.)</p>
</dd>
</dl>

View File

@@ -372,8 +372,8 @@ Namespaces are one honking great idea -- let's do more of those!
or writing thin wrappers:
</p>
<pre class="programlisting"><span class="comment">// write "thin wrappers"</span>
<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">f2</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span> <span class="keyword">return</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span><span class="identifier">y</span><span class="special">);</span> <span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">f1</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">f2</span><span class="special">(</span><span class="keyword">int</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">double</span> <span class="identifier">y</span><span class="special">)</span> <span class="special">{</span> <span class="identifier">f</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span><span class="identifier">y</span><span class="special">);</span> <span class="special">}</span>
<span class="comment">/*...*/</span>

View File

@@ -901,8 +901,8 @@ wrapping as outlined in the [link python.overloading previous section], or
writing thin wrappers:
// write "thin wrappers"
int f1(int x) { return f(x); }
int f2(int x, double y) { return f(x,y); }
int f1(int x) { f(x); }
int f2(int x, double y) { f(x,y); }
/*...*/

View File

@@ -11,10 +11,7 @@ use-project boost
# boost_python library from the project whose global ID is
# /boost/python.
project
: requirements <library>/boost/python//boost_python
<implicit-dependency>/boost//headers
: usage-requirements <implicit-dependency>/boost//headers
;
: requirements <library>/boost/python//boost_python ;
# Declare the three extension modules. You can specify multiple
# source files after the colon separated by spaces.

View File

@@ -12,8 +12,6 @@ use-project boost
# /boost/python.
project boost-python-quickstart
: requirements <library>/boost/python//boost_python
<implicit-dependency>/boost//headers
: usage-requirements <implicit-dependency>/boost//headers
;
# Make the definition of the python-extension rule available

View File

@@ -20,10 +20,7 @@ use-project boost
# boost_python library from the project whose global ID is
# /boost/python.
project
: requirements <library>/boost/python//boost_python
<implicit-dependency>/boost//headers
: usage-requirements <implicit-dependency>/boost//headers
;
: requirements <library>/boost/python//boost_python ;
# Declare the three extension modules. You can specify multiple
# source files after the colon separated by spaces.

View File

@@ -19,6 +19,7 @@
# include <boost/python/detail/copy_ctor_mutates_rhs.hpp>
# include <boost/python/detail/void_ptr.hpp>
# include <boost/python/detail/void_return.hpp>
# include <boost/utility.hpp>
# include <boost/call_traits.hpp>
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_INTEL_WIN, <= 900)

View File

@@ -7,7 +7,7 @@
# include <boost/python/detail/prefix.hpp>
# include <boost/noncopyable.hpp>
# include <boost/utility.hpp>
# include <boost/python/type_id.hpp>
# include <cstddef>

View File

@@ -6,6 +6,7 @@
# define CLASS_DWA20011214_HPP
# include <boost/python/detail/prefix.hpp>
# include <boost/utility.hpp>
# include <boost/python/object_core.hpp>
# include <boost/python/type_id.hpp>
# include <cstddef>

View File

@@ -348,14 +348,31 @@ namespace api
// Macros for forwarding constructors in classes derived from
// object. Derived classes will usually want these as an
// implementation detail
# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \
inline explicit derived(::boost::python::detail::borrowed_reference p) \
: base(p) {} \
inline explicit derived(::boost::python::detail::new_reference p) \
: base(p) {} \
inline explicit derived(::boost::python::detail::new_non_null_reference p) \
# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \
inline explicit derived(python::detail::borrowed_reference p) \
: base(p) {} \
inline explicit derived(python::detail::new_reference p) \
: base(p) {} \
inline explicit derived(python::detail::new_non_null_reference p) \
: base(p) {}
# if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300
# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_
# else
// MSVC6 has a bug which causes an explicit template constructor to
// be preferred over an appropriate implicit conversion operator
// declared on the argument type. Normally, that would cause a
// runtime failure when using extract<T> to extract a type with a
// templated constructor. This additional constructor will turn that
// runtime failure into an ambiguity error at compile-time due to
// the lack of partial ordering, or at least a link-time error if no
// generalized template constructor is declared.
# define BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(derived, base) \
BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS_(derived, base) \
template <class T> \
explicit derived(extract<T> const&);
# endif
//
// object_initializer -- get the handle to construct the object with,
// based on whether T is a proxy or derived from object

View File

@@ -182,12 +182,13 @@ PyTypeObject opaque<Pointee>::type_object =
# define BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee) \
namespace boost { namespace python { \
template<> \
inline type_info type_id<Pointee>() \
inline type_info type_id<Pointee>(BOOST_PYTHON_EXPLICIT_TT_DEF(Pointee)) \
{ \
return type_info (typeid (Pointee *)); \
} \
template<> \
inline type_info type_id<const volatile Pointee&>() \
inline type_info type_id<const volatile Pointee&>( \
BOOST_PYTHON_EXPLICIT_TT_DEF(const volatile Pointee&)) \
{ \
return type_info (typeid (Pointee *)); \
} \

View File

@@ -8,6 +8,7 @@
# include <boost/python/detail/prefix.hpp>
# include <boost/python/object.hpp>
# include <boost/python/refcount.hpp>
# include <boost/utility.hpp>
namespace boost { namespace python {

View File

@@ -69,9 +69,11 @@ struct type_info : private totally_ordered<type_info>
base_id_t m_base_type;
};
// This macro is obsolete. Port away and remove.
# define BOOST_PYTHON_EXPLICIT_TT_DEF(T)
# ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
# define BOOST_PYTHON_EXPLICIT_TT_DEF(T) ::boost::type<T>*
# else
# define BOOST_PYTHON_EXPLICIT_TT_DEF(T)
# endif
template <class T>
inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T))
@@ -97,7 +99,7 @@ inline type_info type_id(BOOST_EXPLICIT_TEMPLATE_TYPE(T))
# define BOOST_PYTHON_SIGNED_INTEGRAL_TYPE_ID(T) \
template <> \
inline type_info type_id<T>() \
inline type_info type_id<T>(BOOST_PYTHON_EXPLICIT_TT_DEF(T)) \
{ \
return type_info(typeid(T)); \
}
@@ -171,13 +173,13 @@ BOOST_PYTHON_DECL std::ostream& operator<<(std::ostream&, type_info const&);
# if !BOOST_WORKAROUND(BOOST_MSVC, == 1200)
template<>
inline type_info type_id<void>()
inline type_info type_id<void>(BOOST_PYTHON_EXPLICIT_TT_DEF(void))
{
return type_info (typeid (void *));
}
# ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
template<>
inline type_info type_id<const volatile void>()
inline type_info type_id<const volatile void>(BOOST_PYTHON_EXPLICIT_TT_DEF(const volatile void))
{
return type_info (typeid (void *));
}

View File

@@ -377,8 +377,7 @@ namespace
static unaryfunc* get_slot(PyObject* obj)
{
#if PY_VERSION_HEX >= 0x03000000
return (PyUnicode_Check(obj)) ? &py_unicode_as_string_unaryfunc :
PyBytes_Check(obj) ? &py_object_identity : 0;
return (PyUnicode_Check(obj)) ? &py_unicode_as_string_unaryfunc : 0;
#else
return (PyString_Check(obj)) ? &obj->ob_type->tp_str : 0;