1
// Copyright David Abrahams 2004. Distributed under the Boost
2
// Software License, Version 1.0. (See accompanying
3
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
#include <boost/python/wrapper.hpp>
7
namespace boost { namespace python {
11
override wrapper_base::get_override(
13
, PyTypeObject* class_object
18
if (handle<> m = handle<>(
20
::PyObject_GetAttrString(
21
this->m_self, const_cast<char*>(name))))
24
PyObject* borrowed_f = 0;
27
PyMethod_Check(m.get())
28
&& ((PyMethodObject*)m.get())->im_self == this->m_self
29
&& class_object->tp_dict != 0
32
borrowed_f = ::PyDict_GetItemString(
33
class_object->tp_dict, const_cast<char*>(name));
37
if (borrowed_f != ((PyMethodObject*)m.get())->im_func)
41
return override(handle<>(detail::none()));
48
PyObject* BOOST_PYTHON_DECL do_polymorphic_ref_to_python(
49
python::detail::wrapper_base const volatile* x, type_info src
56
, "Attempting to returning pointer or reference to instance of %s\n"
57
"for which no corresponding Python object exists. Wrap this function"
58
"with a return return value policy"
66
}} // namespace boost::python::detail