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 )
@@ -97,7 +94,7 @@
(IDL).
-
+
Hello World
@@ -142,7 +139,7 @@
-
Last revised: August 31, 2006 at 05:59:58 GMT
+
Last revised: February 14, 2006 at 02:23:06 GMT
diff --git a/doc/tutorial/doc/html/python/embedding.html b/doc/tutorial/doc/html/python/embedding.html
index 79971d82..26eaff1e 100644
--- a/doc/tutorial/doc/html/python/embedding.html
+++ b/doc/tutorial/doc/html/python/embedding.html
@@ -1,6 +1,3 @@
-
-
-
@@ -43,7 +40,7 @@
Python/C API at all. So stay tuned...
-
+
Building embedded programs
@@ -87,7 +84,7 @@ exe embedded_program # name of the executable
<find-library>$(PYTHON_EMBEDDED_LIBRARY) ;
-
+
Getting started
@@ -96,7 +93,9 @@ exe embedded_program # name of the executable
- #include <boost/python.hpp>
+
+#include
+ <boost/python.hpp>
Call Py_Initialize()
@@ -132,7 +131,7 @@ exe embedded_program # name of the executable
automate the process.
-
+
Reference-counting handles and objects
@@ -166,17 +165,20 @@ exe embedded_program # name of the executable
a new reference is PyRun_String
which we'll discuss in the next section.
-
- Handle is a class template,
- so why haven't we been using any template parameters?
- handle has a single template parameter specifying the
- type of the managed object. This type is PyObject 99%
- of the time, so the parameter was defaulted to PyObject
- for convenience. Therefore we can use the shorthand handle<>
- instead of the longer, but equivalent, handle<PyObject>.
-
+
+
+
Handle is a class
+ template, so why haven't we been using any template
+ parameters?
handle has a
+ single template parameter specifying the type of the managed object.
+ This type is PyObject 99% of the time, so the parameter
+ was defaulted to PyObject for convenience. Therefore
+ we can use the shorthand handle<> instead
+ of the longer, but equivalent, handle<PyObject>.
+
+
-
+
Running Python code
@@ -199,7 +201,7 @@ exe embedded_program # name of the executable
-
+Start symbols
@@ -272,16 +274,18 @@ exe embedded_program # name of the executable
This should create a file called 'hello.txt' in the current directory containing
a phrase that is well-known in programming circles.
-
- Note that we wrap
- the return value of PyRun_String
- in a (nameless) handle even though we are not interested
- in it. If we didn't do this, the the returned object would be kept alive
- unnecessarily. Unless you want to be a Dr. Frankenstein, always wrap PyObject*s
- in handles.
-
+
+
+
Note that
+ we wrap the return value of PyRun_String
+ in a (nameless) handle even though we are not interested
+ in it. If we didn't do this, the the returned object would be kept
+ alive unnecessarily. Unless you want to be a Dr. Frankenstein, always
+ wrap PyObject*s in handles.
+
+
-
+
Beyond handles
@@ -327,15 +331,17 @@ exe embedded_program # name of the executable
intfive_squared=extract<int>(result);
-
- Note that object's
- member function to return the wrapped PyObject* is called
- ptr instead of get. This makes sense
- if you take into account the different functions that object
- and handle perform.
-
+
+
+
Note that
+ object's member function to return the wrapped
+ PyObject* is called ptr instead
+ of get. This makes sense if you take into account
+ the different functions that object and handle
+ perform.
diff --git a/doc/tutorial/doc/html/python/exposing.html b/doc/tutorial/doc/html/python/exposing.html
index 42f188f3..fa5c1096 100644
--- a/doc/tutorial/doc/html/python/exposing.html
+++ b/doc/tutorial/doc/html/python/exposing.html
@@ -1,6 +1,3 @@
-
-
-
@@ -382,10 +379,13 @@
The wrapper template makes
the job of wrapping classes that are meant to overridden in Python, easier.
-
- MSVC6/7 Workaround
- If you are using Microsoft Visual C++ 6 or 7, you have to write f as:
BaseWrap's overridden virtual member function f
in effect calls the corresponding method of the Python object through get_override.
@@ -403,10 +403,14 @@
that the function f is a
pure virtual function.
-
- member function and methods
- Python, like many object oriented languages uses the term methods. Methods correspond roughly to C++'s member functions
-
+
+
+
member function and
+ methods
Python, like many object oriented languages
+ uses the term methods. Methods correspond
+ roughly to C++'s member functions
+
+
@@ -460,11 +464,12 @@
we have to check if there is an override for f.
If none, then we call Base::f().
-
- MSVC6/7 Workaround
- If you are using Microsoft Visual C++ 6 or 7, you have to rewrite
- the line with the *note* as:
returncall<charconst*>(f.ptr());.
-
+
+
+
MSVC6/7 Workaround
+ If you are using Microsoft Visual C++ 6 or 7, you have to rewrite
+ the line with the *note* as:
returncall<charconst*>(f.ptr());.
+
Finally, exposing:
@@ -511,7 +516,7 @@
Class Operators/Special Functions
-
+
Python Operators
@@ -560,7 +565,7 @@
expressions".
-
+
Special Methods
@@ -588,12 +593,11 @@
Need we say more?
-
- What is the business of operator<<? Well, the method str
- requires the operator<<
- to do its work (i.e. operator<< is used by the method defined by
- def(str(self)).
-
+
+
+
What is the business of operator<<? Well, the method str requires the operator<< to do its work (i.e. operator<<
+ is used by the method defined by def(str(self)).
+
diff --git a/doc/tutorial/doc/html/python/functions.html b/doc/tutorial/doc/html/python/functions.html
index 3a9b53b3..81bf8263 100644
--- a/doc/tutorial/doc/html/python/functions.html
+++ b/doc/tutorial/doc/html/python/functions.html
@@ -1,6 +1,3 @@
-
-
-
@@ -209,7 +206,7 @@ Namespaces are one honking great idea -- let's do more of those!
BOOM!
-
+
Call Policies
@@ -290,11 +287,13 @@ Namespaces are one honking great idea -- let's do more of those!
and hold the instance
-
- Remember the Zen, Luke:
- "Explicit is better than implicit" "In the face
- of ambiguity, refuse the temptation to guess"
-
+
+
+
Remember the Zen, Luke:
+ "Explicit is better than implicit" "In
+ the face of ambiguity, refuse the temptation to guess"
+
+
@@ -405,7 +404,7 @@ Namespaces are one honking great idea -- let's do more of those!
-
+
BOOST_PYTHON_FUNCTION_OVERLOADS
@@ -435,7 +434,7 @@ Namespaces are one honking great idea -- let's do more of those!
def("foo",foo,foo_overloads());
-
+
BOOST_PYTHON_MEMBER_FUNCTION_OVERLOADS
@@ -481,7 +480,7 @@ Namespaces are one honking great idea -- let's do more of those!
reference for details.
-
+
init and optional
@@ -548,14 +547,14 @@ Namespaces are one honking great idea -- let's do more of those!
Then...
@@ -38,16 +35,17 @@
necessary to achieve that. We shall use the build tool that comes bundled with
every boost distribution: bjam.
-
- Building without bjam
- Besides bjam, there are of course other ways to get your module built.
- What's written here should not be taken as "the one and only way".
- There are of course other build tools apart from bjam.
- Take note however that the preferred build tool for Boost.Python is
- bjam. There are so many ways to set up the build incorrectly. Experience shows
- that 90% of the "I can't build Boost.Python" problems come from people
- who had to use a different tool.
-
+
+
+
Building without bjam
+ Besides bjam, there are of course other ways to get your module
+ built. What's written here should not be taken as "the one and only
+ way". There are of course other build tools apart from bjam.
+ Take note however that the preferred build tool for Boost.Python
+ is bjam. There are so many ways to set up the build incorrectly. Experience
+ shows that 90% of the "I can't build Boost.Python" problems
+ come from people who had to use a different tool.
+
We shall skip over the details. Our objective will be to simply create the
hello world module and run it in Python. For a complete reference to building
@@ -101,7 +99,7 @@
platforms. The complete list of Bjam executables can be found here.
-
+
Let's Jam!
@@ -152,7 +150,7 @@ extension hello # Declare a Python extension called hello
The last part tells BJam that we are depending on the Boost Python Library.
-
+
Running bjam
@@ -180,10 +178,11 @@ set PYTHON_VERSION=2.2
The above assumes that the Python installation is in c:/dev/tools/python
and that we are using Python version 2.2. You'll have to tweak these appropriately.
-
- Be sure not to include a third number, e.g. not "2.2.1", even if that's the version you
- have.
-
+
+
+
Be sure not to include a third number, e.g. not "2.2.1", even if that's the version
+ you have.
- Beware the common
- pitfall of forgetting that the constructors of most of Python's mutable types
- make copies, just as in Python.
-
+
+
+
Beware the
+ common pitfall of forgetting that the constructors of most of Python's
+ mutable types make copies, just as in Python.
+
Python:
@@ -199,7 +197,7 @@
d['whatever']=3;// modifies the copy
-
+
class_<T> as objects
@@ -297,12 +295,14 @@
above creates a Python class derived from Python's int
type which is associated with the C++ type passed as its first parameter.
-
- what is a scope?
- The scope is a class that has an associated global Python object which
- controls the Python namespace in which new extension classes and wrapped
- functions will be defined as attributes. Details can be found here.
-
+
+
+
what is a scope?
+ The scope is a class that has an associated global Python object
+ which controls the Python namespace in which new extension classes
+ and wrapped functions will be defined as attributes. Details can be
+ found here.
+
You can access those values in Python as
diff --git a/doc/tutorial/doc/html/python/techniques.html b/doc/tutorial/doc/html/python/techniques.html
index a60b7278..4f57d5b4 100644
--- a/doc/tutorial/doc/html/python/techniques.html
+++ b/doc/tutorial/doc/html/python/techniques.html
@@ -1,6 +1,3 @@
-
-
-
@@ -99,12 +96,13 @@
Compiling these files will generate the following Python extensions: core.pyd,
io.pyd and filters.pyd.
-
- The extension .pyd is used for python
- extension modules, which are just shared libraries. Using the default for
- your system, like .so for Unix and .dll
- for Windows, works just as well.
-
+
+
+
The extension .pyd is used
+ for python extension modules, which are just shared libraries. Using
+ the default for your system, like .so for Unix and
+ .dll for Windows, works just as well.
+
Now, we create this directory structure for our Python package:
@@ -427,17 +425,19 @@
exporting it to Python at the same time: changes in a class will only demand
the compilation of a single cpp, instead of the entire wrapper code.
-
- If you're exporting your classes with Pyste,
- take a look at the --multiple option, that generates the
- wrappers in various files as demonstrated here.
-
-
- This method is useful too if you are getting the error
- message "fatal error C1204:Compiler limit:internal structure
- overflow" when compiling a large source file, as explained
- in the FAQ.
-
+
+
+
If you're exporting your classes with Pyste,
+ take a look at the --multiple option, that generates
+ the wrappers in various files as demonstrated here.
+
+
+
+
This method is useful too if you are getting the
+ error message "fatal error C1204:Compiler limit:internal
+ structure overflow" when compiling a large source file,
+ as explained in the FAQ.
+
diff --git a/doc/tutorial/doc/tutorial.qbk b/doc/tutorial/doc/tutorial.qbk
index c90db572..0c49dee7 100644
--- a/doc/tutorial/doc/tutorial.qbk
+++ b/doc/tutorial/doc/tutorial.qbk
@@ -1100,7 +1100,7 @@ overloaded functions in one-shot:
Then...
- .def("foo", (void(*)(bool, int, char))0, foo_overloads());
+ .def("foo", foo, foo_overloads());
Notice though that we have a situation now where we have a minimum of zero
(0) arguments and a maximum of 3 arguments.
diff --git a/doc/tutorial/index.html b/doc/tutorial/index.html
index c2a2aab5..82daf6df 100644
--- a/doc/tutorial/index.html
+++ b/doc/tutorial/index.html
@@ -8,6 +8,11 @@
Automatic redirection failed, click this
- link
+ link
+
opaque_pointer_converter<> is derived from
+
+ to_python_converter
+ and registers itself as an
+
+ lvalue_from_pytype converter from Python objects
+ into pointers to undefined types.
+ Thus it may be used as a converter from opaque pointers into
+ Python objects and vice versa.
+
+
Class template
+ opaque_pointer_converter synopsis
Registers the instance as a
+
+ lvalue_from_pytype converter from Python objects
+ into opaque pointers.
+
The name is used for the type of the Python Objects created;
+ it should be printable but needn't be an
+ ntbs because the object type is
+ not supposed to be user constructible within python scripts.
This macro must be used to define specializations of the
+ type_id function
+ which can't be instantiated for incomplete types.
+
Note
+
In order for this to work in a cross-module environment the macro must
+ be invoked in every translation unit which uses the
+ opaque_pointer_converter.
Python 2.5 introduces a new Py_ssize_t typedef and
- two related macros (PEP 353). The
- <boost/python/ssize_t.hpp> header imports these
- definitions into the boost::python namespace as
- ssize_t, ssize_t_max, and ssize_t_min.
- Appropriate definitions are provided for backward compatibility
- with previous Python versions.
-
-
Typedefs
Imports
- Py_ssize_t into the boost::python namespace if
- available, or provides an appropriate typedef for backward
- compatibility:
-
Imports
- PY_SSIZE_T_MAX and PY_SSIZE_T_MIN as constants
- into the boost::python namespace if available, or
- provides appropriate constants for backward compatibility:
-
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/exporting_an_entire_header.html b/pyste/doc/exporting_an_entire_header.html
index db25325c..d1f22e1e 100644
--- a/pyste/doc/exporting_an_entire_header.html
+++ b/pyste/doc/exporting_an_entire_header.html
@@ -78,8 +78,9 @@ use at you own risk.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/global_variables.html b/pyste/doc/global_variables.html
index 0efd2950..2170e4e8 100644
--- a/pyste/doc/global_variables.html
+++ b/pyste/doc/global_variables.html
@@ -42,8 +42,9 @@ functions, and export those.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/inserting_code.html b/pyste/doc/inserting_code.html
index 97eb70f3..866e5bad 100644
--- a/pyste/doc/inserting_code.html
+++ b/pyste/doc/inserting_code.html
@@ -65,8 +65,9 @@ Will generate:
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/introduction.html b/pyste/doc/introduction.html
index 94388493..352aed2e 100644
--- a/pyste/doc/introduction.html
+++ b/pyste/doc/introduction.html
@@ -66,8 +66,9 @@ Pyste supports the following features:
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/policies.html b/pyste/doc/policies.html
index 3628093b..8061f9b1 100644
--- a/pyste/doc/policies.html
+++ b/pyste/doc/policies.html
@@ -83,8 +83,9 @@ to, though.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/pyste.txt b/pyste/doc/pyste.txt
index 186a31cb..08eda4aa 100644
--- a/pyste/doc/pyste.txt
+++ b/pyste/doc/pyste.txt
@@ -1,10 +1,5 @@
[doc Pyste Documentation]
-[/ Copyright 2003 Bruno da Silva de Oliveira and Joel de Guzman.
-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) ]
-
[def GCCXML [@http://www.gccxml.org GCCXML]]
[def Boost.Python [@../../index.html Boost.Python]]
diff --git a/pyste/doc/renaming_and_excluding.html b/pyste/doc/renaming_and_excluding.html
index ce6654c4..185b8d7e 100644
--- a/pyste/doc/renaming_and_excluding.html
+++ b/pyste/doc/renaming_and_excluding.html
@@ -80,8 +80,9 @@ C::foo that way.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/running_pyste.html b/pyste/doc/running_pyste.html
index 9bd9a3ae..5f72e603 100644
--- a/pyste/doc/running_pyste.html
+++ b/pyste/doc/running_pyste.html
@@ -193,8 +193,9 @@ created again, but no code will be generated.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/smart_pointers.html b/pyste/doc/smart_pointers.html
index cddc96f2..095d2482 100644
--- a/pyste/doc/smart_pointers.html
+++ b/pyste/doc/smart_pointers.html
@@ -77,8 +77,9 @@ specify the smart pointer as the holder for a class, use the functions
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/templates.html b/pyste/doc/templates.html
index a1c1cfef..f2b978bb 100644
--- a/pyste/doc/templates.html
+++ b/pyste/doc/templates.html
@@ -95,8 +95,9 @@ either a string with the types separated by whitespace, or a list of strings
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/the_interface_files.html b/pyste/doc/the_interface_files.html
index 9c020043..117301b4 100644
--- a/pyste/doc/the_interface_files.html
+++ b/pyste/doc/the_interface_files.html
@@ -95,8 +95,9 @@ Note that we specify that B needs to know about A to be proper
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/doc/theme/style.css b/pyste/doc/theme/style.css
index 643df02a..53a6205e 100644
--- a/pyste/doc/theme/style.css
+++ b/pyste/doc/theme/style.css
@@ -1,11 +1,3 @@
-/*=============================================================================
- Copyright (c) 2003 Bruno da Silva de Oliveira
-
- Use, modification and distribution is subject to 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)
-=============================================================================*/
-
body
{
background-image: url(bkd.gif);
diff --git a/pyste/doc/wrappers.html b/pyste/doc/wrappers.html
index 534ae552..0943c0c5 100644
--- a/pyste/doc/wrappers.html
+++ b/pyste/doc/wrappers.html
@@ -117,8 +117,9 @@ code to compile when you set a wrapper for a virtual member function.
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/index.html b/pyste/index.html
index 953b37c1..55b7d39f 100644
--- a/pyste/index.html
+++ b/pyste/index.html
@@ -83,8 +83,9 @@
-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)
+Permission to copy, use, modify, sell and distribute this document
+ is granted provided this copyright notice appears in all copies. This document
+ is provided "as is" without express or implied warranty, and with
+ no claim as to its suitability for any purpose.
diff --git a/pyste/install/pyste.py b/pyste/install/pyste.py
index da926235..9547d5f7 100644
--- a/pyste/install/pyste.py
+++ b/pyste/install/pyste.py
@@ -1,8 +1,4 @@
#!/usr/bin/env python
-# Copyright Bruno da Silva de Oliveira 2006. 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 Pyste import pyste
pyste.main()
diff --git a/pyste/install/setup.py b/pyste/install/setup.py
index c1703981..6c156536 100644
--- a/pyste/install/setup.py
+++ b/pyste/install/setup.py
@@ -1,6 +1,4 @@
-# Copyright Prabhu Ramachandran 2006. 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)
+# contributed by Prabhu Ramachandran
from distutils.core import setup
import sys
diff --git a/release_notes.txt b/release_notes.txt
index 1fd0f1b1..8932a0aa 100644
--- a/release_notes.txt
+++ b/release_notes.txt
@@ -1,9 +1,3 @@
-.. Copyright David Abrahams 2006. 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)
-
-These are old release notes for Boost.Python v1
-
2000-11-22 10:00
Ullrich fixed bug in operator_dispatcher.
diff --git a/src/converter/registry.cpp b/src/converter/registry.cpp
index 179111c6..50da37d5 100644
--- a/src/converter/registry.cpp
+++ b/src/converter/registry.cpp
@@ -57,24 +57,6 @@ BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source)
: this->m_to_python(const_cast(source));
}
-namespace
-{
- template< typename T >
- void delete_node( T* node )
- {
- if( !!node && !!node->next )
- delete_node( node->next );
- delete node;
- }
-}
-
-registration::~registration()
-{
- delete_node(lvalue_chain);
- delete_node(rvalue_chain);
-}
-
-
namespace //
{
typedef registration entry;
diff --git a/src/converter/type_id.cpp b/src/converter/type_id.cpp
index c6a8bf7a..738cfd11 100644
--- a/src/converter/type_id.cpp
+++ b/src/converter/type_id.cpp
@@ -14,7 +14,7 @@
#if defined(__QNXNTO__)
# include
-#else /* defined(__QNXNTO__) */
+#else /* defined(__QNXNTO__) */
#if !defined(__GNUC__) || __GNUC__ >= 3 || __SGI_STL_PORT || __EDG_VERSION__
# include
@@ -35,7 +35,7 @@ class __class_type_info;
# include
# endif
# endif
-#endif /* defined(__QNXNTO__) */
+#endif /* defined(__QNXNTO__) */
namespace boost { namespace python {
@@ -45,7 +45,7 @@ namespace boost { namespace python {
namespace cxxabi {
extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*);
}
-# else /* defined(__QNXNTO__) */
+# else /* defined(__QNXNTO__) */
# ifdef __GNUC__
# if __GNUC__ < 3
@@ -61,10 +61,10 @@ namespace abi
{
extern "C" char* __cxa_demangle(char const*, char*, std::size_t*, int*);
}
-# endif /* __GNUC__ == 3 && __GNUC_MINOR__ == 0 */
-# endif /* __GNUC__ < 3 */
-# endif /* __GNUC__ */
-# endif /* defined(__QNXNTO__) */
+# endif /* __GNUC__ == 3 && __GNUC_MINOR__ == 0 */
+# endif /* __GNUC__ < 3 */
+# endif /* __GNUC__ */
+# endif /* defined(__QNXNTO__) */
namespace
{
diff --git a/src/exec.cpp b/src/exec.cpp
index 5d20bd82..0981f8b1 100644
--- a/src/exec.cpp
+++ b/src/exec.cpp
@@ -34,9 +34,9 @@ object exec_file(str filename, object global, object local)
if (!pyfile) throw std::invalid_argument(std::string(f) + " : no such file");
python::handle<> file(pyfile);
PyObject* result = PyRun_File(PyFile_AsFile(file.get()),
- f,
- Py_file_input,
- global.ptr(), local.ptr());
+ f,
+ Py_file_input,
+ global.ptr(), local.ptr());
if (!result) throw_error_already_set();
return object(detail::new_reference(result));
}
diff --git a/src/list.cpp b/src/list.cpp
index b8f31fb8..79f758a9 100644
--- a/src/list.cpp
+++ b/src/list.cpp
@@ -3,7 +3,6 @@
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include
-#include
namespace boost { namespace python { namespace detail {
@@ -54,7 +53,7 @@ long list_base::index(object_cref value) const
return result;
}
-void list_base::insert(ssize_t index, object_cref item)
+void list_base::insert(int index, object_cref item)
{
if (PyList_CheckExact(this->ptr()))
{
@@ -80,7 +79,7 @@ object list_base::pop()
return this->attr("pop")();
}
-object list_base::pop(ssize_t index)
+object list_base::pop(long index)
{
return this->pop(object(index));
}
diff --git a/src/object/class.cpp b/src/object/class.cpp
index 9daf42b7..efc492c6 100644
--- a/src/object/class.cpp
+++ b/src/object/class.cpp
@@ -20,7 +20,6 @@
#include
#include
#include
-#include
#include
#include
#include
@@ -507,14 +506,13 @@ namespace objects
// were declared, we'll use our class_type() as the single base
// class.
std::size_t const num_bases = (std::max)(num_types - 1, static_cast(1));
- assert(num_bases <= ssize_t_max);
- handle<> bases(PyTuple_New(static_cast(num_bases)));
+ handle<> bases(PyTuple_New(num_bases));
for (std::size_t i = 1; i <= num_bases; ++i)
{
type_handle c = (i >= num_types) ? class_type() : get_class(types[i]);
// PyTuple_SET_ITEM steals this reference
- PyTuple_SET_ITEM(bases.get(), static_cast(i - 1), upcast(c.release()));
+ PyTuple_SET_ITEM(bases.get(), i - 1, upcast(c.release()));
}
// Call the class metatype to create a new class
@@ -532,10 +530,6 @@ namespace objects
if (scope().ptr() != Py_None)
scope().attr(name) = result;
- // For pickle. Will lead to informative error messages if pickling
- // is not enabled.
- result.attr("__reduce__") = object(make_instance_reduce_function());
-
return result;
}
}
@@ -633,6 +627,7 @@ namespace objects
void class_base::enable_pickling_(bool getstate_manages_dict)
{
+ setattr("__reduce__", object(make_instance_reduce_function()));
setattr("__safe_for_unpickling__", object(true));
if (getstate_manages_dict)
diff --git a/src/object/function.cpp b/src/object/function.cpp
index 1f094f42..653343b9 100644
--- a/src/object/function.cpp
+++ b/src/object/function.cpp
@@ -14,7 +14,6 @@
#include
#include
#include
-#include
#include
#include
@@ -65,7 +64,7 @@ function::function(
= max_arity > num_keywords ? max_arity - num_keywords : 0;
- ssize_t tuple_size = num_keywords ? max_arity : 0;
+ unsigned tuple_size = num_keywords ? max_arity : 0;
m_arg_names = object(handle<>(PyTuple_New(tuple_size)));
if (num_keywords != 0)
@@ -159,9 +158,7 @@ PyObject* function::call(PyObject* args, PyObject* keywords) const
else
{
// build a new arg tuple, will adjust its size later
- assert(max_arity <= ssize_t_max);
- inner_args = handle<>(
- PyTuple_New(static_cast(max_arity)));
+ inner_args = handle<>(PyTuple_New(max_arity));
// Fill in the positional arguments
for (std::size_t i = 0; i < n_unnamed_actual; ++i)
@@ -296,7 +293,7 @@ void function::argument_error(PyObject* args, PyObject* /*keywords*/) const
% make_tuple(this->m_namespace, this->m_name);
list actual_args;
- for (ssize_t i = 0; i < PyTuple_Size(args); ++i)
+ for (int i = 0; i < PyTuple_Size(args); ++i)
{
char const* name = PyTuple_GetItem(args, i)->ob_type->tp_name;
actual_args.append(str(name));
diff --git a/src/object/pickle_support.cpp b/src/object/pickle_support.cpp
index f70eb17f..897ee633 100644
--- a/src/object/pickle_support.cpp
+++ b/src/object/pickle_support.cpp
@@ -8,7 +8,6 @@
#include
#include
#include
-#include
namespace boost { namespace python {
@@ -20,22 +19,6 @@ namespace {
object instance_class(instance_obj.attr("__class__"));
result.append(instance_class);
object none;
- if (!getattr(instance_obj, "__safe_for_unpickling__", none))
- {
- str type_name(getattr(instance_class, "__name__"));
- str module_name(getattr(instance_class, "__module__", object("")));
- if (module_name)
- module_name += ".";
-
- PyErr_SetObject(
- PyExc_RuntimeError,
- ( "Pickling of \"%s\" instances is not enabled"
- " (http://www.boost.org/libs/python/doc/v2/pickle.html)"
- % (module_name+type_name)).ptr()
- );
-
- throw_error_already_set();
- }
object getinitargs = getattr(instance_obj, "__getinitargs__", none);
tuple initargs;
if (getinitargs.ptr() != none.ptr()) {
diff --git a/src/object_protocol.cpp b/src/object_protocol.cpp
index 8606fa2b..c23b8bb3 100755
--- a/src/object_protocol.cpp
+++ b/src/object_protocol.cpp
@@ -6,7 +6,6 @@
#include
#include
#include
-#include
namespace boost { namespace python { namespace api {
@@ -107,7 +106,7 @@ namespace // slicing code copied directly out of the Python implementation
PySequenceMethods *sq = tp->tp_as_sequence;
if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
- ssize_t ilow = 0, ihigh = ssize_t_max;
+ int ilow = 0, ihigh = INT_MAX;
if (!_PyEval_SliceIndex(v, &ilow))
return NULL;
if (!_PyEval_SliceIndex(w, &ihigh))
@@ -134,7 +133,7 @@ namespace // slicing code copied directly out of the Python implementation
PySequenceMethods *sq = tp->tp_as_sequence;
if (sq && sq->sq_slice && ISINT(v) && ISINT(w)) {
- ssize_t ilow = 0, ihigh = ssize_t_max;
+ int ilow = 0, ihigh = INT_MAX;
if (!_PyEval_SliceIndex(v, &ilow))
return -1;
if (!_PyEval_SliceIndex(w, &ihigh))
diff --git a/src/str.cpp b/src/str.cpp
index 5216cf54..c452a285 100644
--- a/src/str.cpp
+++ b/src/str.cpp
@@ -3,7 +3,6 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#include
#include
-#include
namespace boost { namespace python { namespace detail {
@@ -22,25 +21,10 @@ str_base::str_base(const char* s)
: object(detail::new_reference(::PyString_FromString(s)))
{}
-namespace {
-
- ssize_t str_size_as_py_ssize_t(std::size_t n)
- {
- if (n > ssize_t_max)
- {
- throw std::range_error("str size > ssize_t_max");
- }
- return static_cast(n);
- }
-
-} // namespace
-
str_base::str_base(char const* start, char const* finish)
: object(
detail::new_reference(
- ::PyString_FromStringAndSize(
- start, str_size_as_py_ssize_t(finish - start)
- )
+ ::PyString_FromStringAndSize(start, finish - start)
)
)
{}
@@ -48,9 +32,7 @@ str_base::str_base(char const* start, char const* finish)
str_base::str_base(char const* start, std::size_t length) // new str
: object(
detail::new_reference(
- ::PyString_FromStringAndSize(
- start, str_size_as_py_ssize_t(length)
- )
+ ::PyString_FromStringAndSize(start, length)
)
)
{}
diff --git a/test/andreas_beyer.cpp b/test/andreas_beyer.cpp
index da3aa751..a39e9f04 100755
--- a/test/andreas_beyer.cpp
+++ b/test/andreas_beyer.cpp
@@ -1,6 +1,3 @@
-// Copyright David Abrahams 2006. 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
#include
#include
diff --git a/test/args.py b/test/args.py
index 695a07dc..cff6a7b8 100644
--- a/test/args.py
+++ b/test/args.py
@@ -84,8 +84,6 @@
(2, 4.25, 'wow')
>>> q.f1()
(1, 4.25, 'wow')
->>> q.f2.__doc__.splitlines()[-3]
-"f2's docstring"
>>> X.f.__doc__.splitlines()[:2]
["This is X.f's docstring", 'C++ signature:']
diff --git a/test/crossmod_exception.py b/test/crossmod_exception.py
index dd50dae2..c8430849 100644
--- a/test/crossmod_exception.py
+++ b/test/crossmod_exception.py
@@ -1,6 +1,9 @@
-# Copyright (C) 2003 Rational Discovery LLC. 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)
+# Copyright (C) 2003 Rational Discovery LLC
+# Permission to copy, use, modify, sell and distribute this software
+# is granted provided this copyright notice appears in all
+# copies. This software is provided "as is" without express or
+# implied warranty, and with no claim as to its suitability for any
+# purpose.
print "running..."
diff --git a/test/exec.cpp b/test/exec.cpp
index 1843d183..889a5324 100644
--- a/test/exec.cpp
+++ b/test/exec.cpp
@@ -54,7 +54,7 @@ void exec_test()
// Register the module with the interpreter
if (PyImport_AppendInittab("embedded_hello", initembedded_hello) == -1)
throw std::runtime_error("Failed to add embedded_hello to the interpreter's "
- "builtin modules");
+ "builtin modules");
// Retrieve the main module
python::object main = python::import("__main__");
diff --git a/test/exec.py b/test/exec.py
index 5a8faf79..5c1ad592 100644
--- a/test/exec.py
+++ b/test/exec.py
@@ -1,6 +1,2 @@
-# Copyright Stefan Seefeld 2006. 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)
-
print 'Hello World !'
number = 42
diff --git a/test/keywords.cpp b/test/keywords.cpp
index 39bac062..599f98d8 100755
--- a/test/keywords.cpp
+++ b/test/keywords.cpp
@@ -103,7 +103,6 @@ BOOST_PYTHON_MODULE(keywords)
, init >()
)
.def("set", &Bar::set, bar_set())
- .def("set2", &Bar::set, bar_set("set2's docstring"))
.def("seta", &Bar::seta, arg("a"))
.def("a", &Bar::geta)
diff --git a/test/keywords_test.py b/test/keywords_test.py
index aa31b76b..ff4d8014 100644
--- a/test/keywords_test.py
+++ b/test/keywords_test.py
@@ -80,8 +80,6 @@
>>> f.set(1,1.0,"1")
>>> f.a(), f.b(), f.n()
(1, 1.0, '1')
->>> f.set2.__doc__.splitlines()[-3]
-"set2's docstring"
'''
diff --git a/test/map_indexing_suite.cpp b/test/map_indexing_suite.cpp
index 8b5e3b6e..1a548d31 100644
--- a/test/map_indexing_suite.cpp
+++ b/test/map_indexing_suite.cpp
@@ -26,62 +26,6 @@ std::string x_value(X const& x)
return "gotya " + x.s;
}
-struct A
-{
- int value;
- A() : value(0){};
- A(int v) : value(v) {};
-};
-
-bool operator==(const A& v1, const A& v2)
-{
- return (v1.value == v2.value);
-}
-
-struct B
-{
- A a;
-};
-
-// Converter from A to python int
-struct AToPython
-{
- static PyObject* convert(const A& s)
- {
- return boost::python::incref(boost::python::object((int)s.value).ptr());
- }
-};
-
-// Conversion from python int to A
-struct AFromPython
-{
- AFromPython()
- {
- boost::python::converter::registry::push_back(
- &convertible,
- &construct,
- boost::python::type_id< A >());
- }
-
- static void* convertible(PyObject* obj_ptr)
- {
- if (!PyInt_Check(obj_ptr)) return 0;
- return obj_ptr;
- }
-
- static void construct(
- PyObject* obj_ptr,
- boost::python::converter::rvalue_from_python_stage1_data* data)
- {
- void* storage = (
- (boost::python::converter::rvalue_from_python_storage< A >*)
- data)-> storage.bytes;
-
- new (storage) A((int)PyInt_AsLong(obj_ptr));
- data->convertible = storage;
- }
-};
-
BOOST_PYTHON_MODULE(map_indexing_suite_ext)
{
class_("X")
@@ -114,18 +58,6 @@ BOOST_PYTHON_MODULE(map_indexing_suite_ext)
class_ > >("TestMap")
.def(map_indexing_suite >, true>())
;
-
- to_python_converter< A , AToPython >();
- AFromPython();
-
- class_< std::map >("AMap")
- .def(map_indexing_suite, true >())
- ;
-
- class_< B >("B")
- .add_property("a", make_getter(&B::a, return_value_policy()),
- make_setter(&B::a, return_value_policy()))
- ;
}
#include "module_tail.cpp"
diff --git a/test/map_indexing_suite.py b/test/map_indexing_suite.py
index 01fa943d..646f6194 100644
--- a/test/map_indexing_suite.py
+++ b/test/map_indexing_suite.py
@@ -11,7 +11,6 @@
>>> assert "map_indexing_suite_IntMap_entry" in dir()
>>> assert "map_indexing_suite_TestMap_entry" in dir()
>>> assert "map_indexing_suite_XMap_entry" in dir()
->>> assert "map_indexing_suite_AMap_entry" in dir()
>>> x = X('hi')
>>> x
hi
@@ -202,18 +201,6 @@ kiwi
... dom = el.data()
joel kimpo
-#####################################################################
-# Test custom converter...
-#####################################################################
-
->>> am = AMap()
->>> am[3] = 4
->>> am[3]
-4
->>> for i in am:
-... i.data()
-4
-
#####################################################################
# END....
#####################################################################
diff --git a/test/module_tail.cpp b/test/module_tail.cpp
index 02cfc6a3..594949ef 100644
--- a/test/module_tail.cpp
+++ b/test/module_tail.cpp
@@ -32,7 +32,7 @@ extern "C" void (*old_translator)(unsigned, EXCEPTION_POINTERS*)
#include
struct test_failure : std::exception
{
- test_failure(char const* expr, char const* /*function*/, char const* file, unsigned line)
+ test_failure(char const* expr, char const* function, char const* file, unsigned line)
: msg(file + boost::python::str(":%s:") % line + ": Boost.Python assertion failure: " + expr)
{}
diff --git a/test/operators_wrapper.cpp b/test/operators_wrapper.cpp
deleted file mode 100644
index f00aa2b4..00000000
--- a/test/operators_wrapper.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "boost/python.hpp"
-#include
-
-struct vector
-{
- virtual ~vector() {}
-
- vector operator+( const vector& x ) const
- { return vector(); }
-
- vector& operator+=( const vector& x )
- { return *this; }
-
- vector operator-() const
- { return *this; }
-};
-
-struct dvector : vector
-{};
-
-using namespace boost::python;
-
-struct vector_wrapper
- : vector, wrapper< vector >
-{
- vector_wrapper(vector const&) {}
- vector_wrapper() {}
-};
-
-BOOST_PYTHON_MODULE( operators_wrapper_ext )
-{
- class_< vector_wrapper >( "vector" )
- .def( self + self )
- .def( self += self )
- .def( -self )
- ;
-
- scope().attr("v") = vector();
- std::auto_ptr dp(new dvector);
- register_ptr_to_python< std::auto_ptr >();
- scope().attr("d") = dp;
-}
diff --git a/test/operators_wrapper.py b/test/operators_wrapper.py
deleted file mode 100644
index 6c889b0a..00000000
--- a/test/operators_wrapper.py
+++ /dev/null
@@ -1,11 +0,0 @@
-from operators_wrapper_ext import *
-
-class D2(vector): pass
-d2 = D2()
-
-for lhs in (v,d,d2):
- -lhs
- for rhs in (v,d,d2):
- lhs + rhs
- lhs += rhs
-
diff --git a/test/pickle1.cpp b/test/pickle1.cpp
index c1f8c805..bcdb2633 100644
--- a/test/pickle1.cpp
+++ b/test/pickle1.cpp
@@ -45,8 +45,6 @@ namespace {
}
};
- // To support test of "pickling not enabled" error message.
- struct noop {};
}
BOOST_PYTHON_MODULE(pickle1_ext)
@@ -56,7 +54,4 @@ BOOST_PYTHON_MODULE(pickle1_ext)
.def("greet", &world::greet)
.def_pickle(world_pickle_suite())
;
-
- // To support test of "pickling not enabled" error message.
- class_("noop");
}
diff --git a/test/pickle1.py b/test/pickle1.py
index 8369768d..bb66b31b 100644
--- a/test/pickle1.py
+++ b/test/pickle1.py
@@ -18,11 +18,6 @@ r'''>>> import pickle1_ext
Hello from California!
>>> print wl.greet()
Hello from California!
-
- >>> noop = pickle1_ext.noop()
- >>> try: pickle.dumps(noop)
- ... except RuntimeError, e: print str(e)[:55]
- Pickling of "pickle1_ext.noop" instances is not enabled
'''
def run(args = None):
diff --git a/test/pointer_vector.cpp b/test/pointer_vector.cpp
index c1f7dbd4..4c446d1a 100644
--- a/test/pointer_vector.cpp
+++ b/test/pointer_vector.cpp
@@ -1,6 +1,3 @@
-// Copyright Joel de Guzman 2005-2006. 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
#include
#include
diff --git a/test/vector_indexing_suite.cpp b/test/vector_indexing_suite.cpp
index 0f9cd74c..a2dd1403 100644
--- a/test/vector_indexing_suite.cpp
+++ b/test/vector_indexing_suite.cpp
@@ -53,10 +53,5 @@ BOOST_PYTHON_MODULE(vector_indexing_suite_ext)
class_ >("BoolVec")
.def(vector_indexing_suite >())
;
-
- // vector of strings
- class_ >("StringVec")
- .def(vector_indexing_suite >())
- ;
}
diff --git a/test/vector_indexing_suite.py b/test/vector_indexing_suite.py
index 9bb75700..302fc67c 100644
--- a/test/vector_indexing_suite.py
+++ b/test/vector_indexing_suite.py
@@ -321,14 +321,6 @@ e
>>> print_xvec(v)
[ a b c d e f g h i j ]
-#####################################################################
-# vector of strings
-#####################################################################
->>> sv = StringVec()
->>> sv.append('a')
->>> print sv[0]
-a
-
#####################################################################
# END....
#####################################################################
diff --git a/test/voidptr.cpp b/test/voidptr.cpp
index 82e412be..9acc5b18 100755
--- a/test/voidptr.cpp
+++ b/test/voidptr.cpp
@@ -12,23 +12,23 @@ static void *test=(void *) 78;
void *get()
{
- return test;
+ return test;
}
void *getnull()
{
- return 0;
+ return 0;
}
void use(void *a)
{
- if(a!=test)
+ if(a!=test)
throw std::runtime_error(std::string("failed"));
}
int useany(void *a)
{
- return a ? 1 : 0;
+ return a ? 1 : 0;
}
@@ -36,8 +36,8 @@ namespace bpl = boost::python;
BOOST_PYTHON_MODULE(voidptr_ext)
{
- bpl::def("get", &::get, bpl::return_value_policy());
- bpl::def("getnull", &::getnull, bpl::return_value_policy());
- bpl::def("use", &::use);
- bpl::def("useany", &::useany);
+ bpl::def("get", &::get, bpl::return_value_policy());
+ bpl::def("getnull", &::getnull, bpl::return_value_policy());
+ bpl::def("use", &::use);
+ bpl::def("useany", &::useany);
}