Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

Boost.Python - News/Change Log

Boost.Python

News/Change Log

Current SVN
  • Python 3 support:
    • All the current Boost.Python test cases passed. Extension modules using Boost.Python expected to support Python 3 smoothly.
    • Introduced object.contains where x.contains(y) is equivalent to Python code y in x. Now dict.has_key is just a wrapper of object.contains.
    • When building against Python 3, str.decode will be removed.
    • When building against Python 3, the original signature of list.sort, which is:
      void sort(object_cref cmpfunc);
      will change to:
      void sort(args_proxy const &args, kwds_proxy const &kwds);
      This is because in Python 3 list.sort requires all its arguments be keyword arguments. So you should call it like this:
      x.sort(*tuple(), **dict(make_tuple(make_tuple("reverse", true))));
    • According to PEP 3123, when building Boost.Python against Python older than 2.6, the following macros will be defined in Boost.Python header:
      # define Py_TYPE(o)    (((PyObject*)(o))->ob_type)
      # define Py_REFCNT(o)  (((PyObject*)(o))->ob_refcnt)
      # define Py_SIZE(o)    (((PyVarObject*)(o))->ob_size)
      So extension writers can use these macro directly, to make code clean and compatible with Python 3.
1.39.0 Release
  • Pythonic signatures are now automatically appended to the docstrings.
  • Use docstring_options.hpp header control the content of docstrings.
  • This new feature increases the size of the modules by about 14%. If this is not acceptable it can be turned off by defining the macro BOOST_PYTHON_NO_PY_SIGNATURES. Modules compiled with and without the macro defined are compatible.
  • If BOOST_PYTHON_NO_PY_SIGNATURES is undefined, this version defines the macro BOOST_PYTHON_SUPPORTS_PY_SIGNATURES. This allows writing code that will compile with older version of Boost.Python (see here).
  • By defining BOOST_PYTHON_PY_SIGNATURES_PROPER_INIT_SELF_TYPE, and at a cost of another 14% size increase, proper pythonic type is generated for the "self" parameter of the __init__ methods.
  • To support this new feature changes were made to the to_python_converter.hpp, default_call_policies, ResultConverter, CallPolicies and some others. Efforts were made not to have interface breaking changes.
12 May 2007 - 1.34.0 release
  • C++ signatures are now automatically appended to the docstrings.
  • New docstring_options.hpp header to control the content of docstrings.
  • Support for converting void* to/from python, with opaque_pointer_converter as the return value policy. Thanks to Niall Douglas for the initial patch.
19 October 2005 - 1.33.1 release
  • wrapper<T> can now be used as expected with a held type of some-smart-pointer<T>
  • The build now assumes Python 2.4 by default, rather than 2.2
  • Support Python that's built without Unicode support
  • Support for wrapping classes with overloaded address-of (&) operators
14 August 2005 - 1.33 release
  • Support for docstrings on nonstatic properties.
  • We now export the client-provided docstrings for init<optional<> > and XXX_FUNCTION_OVERLOADS() for only the last overload.
  • Fixed some support for Embedded VC++ 4
  • 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.
  • Support for exposing vector<T*> with the indexing suite.
  • Support for GCC-3.3 on MacOS.
  • updated visual studio project build file to include two new files (slice.cpp and wrapper.cpp)
  • Added search feature to the index page.
  • Numerous fixes to the tutorial
  • Numerous workarounds for MSVC 6 and 7, GCC 2.96, and EDG 2.45
11 March 2005
  • Added a hack that will fool PyDoc into working with Boost.Python, thanks to Nick Rasmussen
19 November 2004 - 1.32 release
  • Updated to use the Boost Software License.
  • A new, better method of wrapping classes with virtual functions has been implemented.
  • Support for upcoming GCC symbol export control features have been folded in, thanks to Niall Douglas.
  • Improved support for std::auto_ptr-like types.
  • The Visual C++ bug that makes top-level cv-qualification of function parameter types part of the function type has been worked around.
  • Components used by other libraries have been moved out of python/detail and into boost/detail to improve dependency relationships.
  • Miscellaneous bug fixes and compiler workarounds.
8 Sept 2004
Support for Python's Bool type, thanks to Daniel Holth.
11 Sept 2003
  • 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.
  • Added builtin std::wstring conversions
  • Added std::out_of_range => Python IndexError exception conversion, thanks to Raoul Gough
9 Sept 2003
Added new str
constructors which take a range of characters, allowing strings containing nul ('\0') characters.
8 Sept 2003
Added the ability to create methods from function objects (with an operator()); see the make_function docs for more info.
10 August 2003
Added the new properties unit tests contributed by Roman Yakovenko and documented add_static_property at his urging.
1 August 2003
Added the new arg class contributed by Nikolay Mladenov which supplies the ability to wrap functions that can be called with ommitted arguments in the middle:
void f(int x = 0, double y = 3.14, std::string z = std::string("foo"));

BOOST_PYTHON_MODULE(test)
{
   def("f", f
       , (arg("x", 0), arg("y", 3.14), arg("z", "foo")));
}
 
And in Python:
>>> import test
>>> f(0, z = "bar")
>>> f(z = "bar", y = 0.0)
Thanks, Nikolay!
22 July 2003
Killed the dreaded "bad argument type for builtin operation" error. Argument errors now show the actual and expected argument types!
19 July 2003
Added the new return_arg policy from Nikolay Mladenov. Thanks, Nikolay!
18 March, 2003
Gottfried Ganßauge has contributed opaque pointer support.
Bruno da Silva de Oliveira has contributed the exciting Pyste ("Pie-steh") package.
24 February 2003
Finished improved support for boost::shared_ptr. Now any wrapped object of C++ class X can be converted automatically to shared_ptr<X>, regardless of how it was wrapped. The shared_ptr will manage the lifetime of the Python object which supplied the X, rather than just the X object itself, and when such a shared_ptr is converted back to Python, the original Python object will be returned.
19 January 2003
Integrated staticmethod support from Nikolay Mladenov. Thanks, Nikolay!
29 December 2002
Added Visual Studio project file and instructions from Brett Calcott. Thanks, Brett!
20 December 2002
Added automatic downcasting for pointers, references, and smart pointers to polymorphic class types upon conversion to python
18 December 2002
Optimized from_python conversions for wrapped classes by putting the conversion logic in the shared library instead of registering separate converters for each class in each extension module
19 November 2002
Removed the need for users to cast base class member function pointers when used as arguments to add_property
13 December 2002
Allow exporting of enum_ values into enclosing scope.
Fixed unsigned integer conversions to deal correctly with numbers that are out-of-range of signed long.
14 November 2002
Auto-detection of class data members wrapped with make_getter
13 November 2002
Full Support for std::auto_ptr<> added.
October 2002
Ongoing updates and improvements to tutorial documentation
10 October 2002
Boost.Python V2 is released!

Revised 19 November 2004

© Copyright Dave Abrahams 2002-2003.