From 056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 Mon Sep 17 00:00:00 2001 From: alexv-smirnov Date: Wed, 15 Mar 2023 19:59:12 +0300 Subject: add library/cpp/actors, ymake build to ydb oss export --- .../boost/python/src/object/iterator.cpp | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 contrib/restricted/boost/python/src/object/iterator.cpp (limited to 'contrib/restricted/boost/python/src/object/iterator.cpp') diff --git a/contrib/restricted/boost/python/src/object/iterator.cpp b/contrib/restricted/boost/python/src/object/iterator.cpp new file mode 100644 index 00000000000..6b885a982c4 --- /dev/null +++ b/contrib/restricted/boost/python/src/object/iterator.cpp @@ -0,0 +1,39 @@ +// Copyright David Abrahams 2002. +// 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 +#include + +namespace boost { namespace python { namespace objects { + +namespace +{ + PyObject* identity(PyObject* args_, PyObject*) + { + PyObject* x = PyTuple_GET_ITEM(args_,0); + Py_INCREF(x); + return x; + } +} + +BOOST_PYTHON_DECL object const& identity_function() +{ + static object result( + function_object( + py_function(&identity, mpl::vector2()) + ) + ); + return result; +} + +void stop_iteration_error() +{ + PyErr_SetObject(PyExc_StopIteration, Py_None); + throw_error_already_set(); +} + +}}} // namespace boost::python::objects -- cgit v1.3