2
#include<boost/python/object.hpp>
3
#include<boost/version.hpp>
4
#if BOOST_VERSION<103400
5
// taken from boost-1.34/python/object.hpp
7
// Copyright David Abrahams 2002.
8
// Distributed under the Boost Software License, Version 1.0. (See
9
// accompanying file LICENSE_1_0.txt or copy at
10
// http://www.boost.org/LICENSE_1_0.txt)
12
namespace boost { namespace python {
14
inline ssize_t len(object const& obj)
16
ssize_t result = PyObject_Length(obj.ptr());
17
if (PyErr_Occurred()) throw_error_already_set();
21
}} // namespace boost::python
22
#endif // BOOST_VERSION<103400