summaryrefslogtreecommitdiffstats
path: root/contrib/restricted/boost/python/src/slice.cpp
diff options
context:
space:
mode:
authoralexv-smirnov <[email protected]>2023-03-15 19:59:12 +0300
committeralexv-smirnov <[email protected]>2023-03-15 19:59:12 +0300
commit056bb284ccf8dd6793ec3a54ffa36c4fb2b9ad11 (patch)
tree4740980126f32e3af7937ba0ca5f83e59baa4ab0 /contrib/restricted/boost/python/src/slice.cpp
parent269126dcced1cc8b53eb4398b4a33e5142f10290 (diff)
add library/cpp/actors, ymake build to ydb oss export
Diffstat (limited to 'contrib/restricted/boost/python/src/slice.cpp')
-rw-r--r--contrib/restricted/boost/python/src/slice.cpp37
1 files changed, 37 insertions, 0 deletions
diff --git a/contrib/restricted/boost/python/src/slice.cpp b/contrib/restricted/boost/python/src/slice.cpp
new file mode 100644
index 00000000000..ee55f948461
--- /dev/null
+++ b/contrib/restricted/boost/python/src/slice.cpp
@@ -0,0 +1,37 @@
+#include "boost/python/slice.hpp"
+
+// Copyright (c) 2004 Jonathan Brandmeyer
+// Use, modification and distribution are 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)
+
+
+namespace boost { namespace python { namespace detail {
+
+slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step)
+ : object(detail::new_reference( PySlice_New(start, stop, step)))
+{
+}
+
+object
+slice_base::start() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->start));
+}
+
+object
+slice_base::stop() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->stop));
+}
+
+object
+slice_base::step() const
+{
+ return object( detail::borrowed_reference(
+ ((PySliceObject*)this->ptr())->step));
+}
+
+} } } // !namespace boost::python::detail